Migration Consistency Tests #16653
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Migration Consistency Tests | |
on: | |
pull_request: | |
merge_group: | |
types: | |
- checks_requested | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
# Allow more retries for network requests in cargo (downloading crates) and | |
# rustup (installing toolchains). This should help to reduce flaky CI failures | |
# from transient network timeouts or other issues. | |
CARGO_NET_RETRY: 10 | |
RUSTUP_MAX_RETRIES: 10 | |
# Use cargo's sparse index protocol | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
migration_verify: | |
name: Verify consistency of migrations with `schema.rs` file | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable 2 weeks ago | |
- uses: baptiste0928/[email protected] | |
with: | |
crate: diesel_cli | |
features: postgres | |
args: "--no-default-features" | |
- name: Verify `diesel migration run` | |
shell: bash | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres | |
run: diesel migration run --locked-schema | |
- name: Verify `diesel migration redo` | |
shell: bash | |
env: | |
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres | |
run: diesel migration redo -a --locked-schema |