Try sequence merges 1

This commit is contained in:
Dessalines 2024-05-16 11:10:13 -04:00
parent 8f34d977b3
commit 7cb5289064

View file

@ -24,7 +24,7 @@ variables:
"diesel.toml", "diesel.toml",
".gitmodules", ".gitmodules",
] ]
- &install_binstall | - install_binstall: &install_binstall
- wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz - wget https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
- tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz - tar -xvf cargo-binstall-x86_64-unknown-linux-musl.tgz
- cp cargo-binstall /usr/local/cargo/bin - cp cargo-binstall /usr/local/cargo/bin
@ -48,6 +48,20 @@ steps:
when: when:
- event: [pull_request, tag] - event: [pull_request, tag]
check_diesel_schema:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
commands:
- <<: *install_binstall
# Install diesel_cli
- cargo binstall -y diesel_cli -- --no-default-features --features postgres
- diesel migration run
- diesel print-schema --config-file=diesel.toml > tmp.schema
- diff tmp.schema crates/db_schema/src/schema.rs
when: *slow_check_paths
prettier_check: prettier_check:
image: tmknom/prettier:3.0.0 image: tmknom/prettier:3.0.0
commands: commands:
@ -83,7 +97,7 @@ steps:
cargo_machete: cargo_machete:
image: rustlang/rust:nightly image: rustlang/rust:nightly
commands: commands:
- *install_binstall - <<: *install_binstall
- cargo binstall -y cargo-machete - cargo binstall -y cargo-machete
- cargo machete - cargo machete
when: when:
@ -134,20 +148,6 @@ steps:
- diff config/defaults.hjson config/defaults_current.hjson - diff config/defaults.hjson config/defaults_current.hjson
when: *slow_check_paths when: *slow_check_paths
check_diesel_schema:
image: *rust_image
environment:
CARGO_HOME: .cargo_home
DATABASE_URL: postgres://lemmy:password@database:5432/lemmy
commands:
- *install_binstall
# Install diesel_cli
- cargo binstall -y diesel_cli -- --no-default-features --features postgres
- diesel migration run
- diesel print-schema --config-file=diesel.toml > tmp.schema
- diff tmp.schema crates/db_schema/src/schema.rs
when: *slow_check_paths
check_db_perf_tool: check_db_perf_tool:
image: *rust_image image: *rust_image
environment: environment:
@ -202,7 +202,7 @@ steps:
PGHOST: database PGHOST: database
PGDATABASE: lemmy PGDATABASE: lemmy
commands: commands:
- *install_binstall - <<: *install_binstall
# Install diesel_cli # Install diesel_cli
- cargo binstall -y diesel_cli -- --no-default-features --features postgres - cargo binstall -y diesel_cli -- --no-default-features --features postgres
- export PATH="$CARGO_HOME/bin:$PATH" - export PATH="$CARGO_HOME/bin:$PATH"
@ -283,7 +283,7 @@ steps:
publish_to_crates_io: publish_to_crates_io:
image: *rust_image image: *rust_image
commands: commands:
- *install_binstall - <<: *install_binstall
# Install cargo-workspaces # Install cargo-workspaces
- cargo binstall -y cargo-workspaces - cargo binstall -y cargo-workspaces
- cp -r migrations crates/db_schema/ - cp -r migrations crates/db_schema/