Skip to content

Commit

Permalink
ci: run db migrations before test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajil1213 committed Nov 19, 2024
1 parent 8228976 commit db0e3b1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ jobs:
with:
version: "v0.8.1" # sccache version

- run: cargo hack check --locked
- name: Install sqlx-cli
run: cargo install sqlx-cli --locked

- run: make migrate && cargo hack check --locked
5 changes: 4 additions & 1 deletion .github/workflows/functional.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ jobs:
with:
cache-on-failure: true

- name: Install sqlx-cli
run: cargo install sqlx-cli --locked

- name: Build Cargo project
run: cargo build --locked
run: make migrate && cargo build --locked

- name: Run functional tests (1)
id: funcTestsRun1
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,12 @@ jobs:
with:
cache-on-failure: true

- name: Install sqlx-cli
run: cargo install sqlx-cli --locked

- name: Run tests
run: |
cargo nextest run -p integration-tests --locked --profile ci --no-capture
make migrate && cargo nextest run -p integration-tests --locked --profile ci --no-capture
- name: Test Summary
uses: test-summary/action@v2
if: always()
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,19 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly-2024-07-27

- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- run: SKIP_GUEST_BUILD=1 cargo clippy --workspace --lib --examples --tests --benches --all-features --all-targets --locked

- name: Install sqlx-cli
run: cargo install sqlx-cli --locked

- run: make migrate && SKIP_GUEST_BUILD=1 cargo clippy --workspace --lib --examples --tests --benches --all-features --all-targets --locked
env:
RUSTFLAGS: -D warnings

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ jobs:
- name: Set RUST_LOG
run: echo "RUST_LOG=${{ github.event.inputs.RUST_LOG }}" >> $GITHUB_ENV

- name: Install sqlx-cli
run: cargo install sqlx-cli --locked

- name: Run tests with coverage
run: |
cargo llvm-cov --workspace --locked nextest --profile ci --lcov --output-path lcov.info
make migrate && cargo llvm-cov --workspace --locked nextest --profile ci --lcov --output-path lcov.info
- name: Test Summary
uses: test-summary/action@v2
Expand Down

0 comments on commit db0e3b1

Please sign in to comment.