Skip to content

Commit

Permalink
Move slow test build step to separate job
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Dec 19, 2024
1 parent 419651a commit fd7f052
Showing 1 changed file with 73 additions and 40 deletions.
113 changes: 73 additions & 40 deletions .github/workflows/slowtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,62 @@ env:
RUST_LOG: info,libp2p=off,node=error

jobs:
build-test-artifacts-postgres:
name: Build test artifacts (postgres)
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: rui314/setup-mold@v1

- uses: actions/checkout@v4

- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
cache-provider: buildjet

- name: Build and archive tests
run: cargo nextest archive --locked --workspace --archive-file nextest-archive-postgres.tar.zst

- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive-postgres
path: nextest-archive-postgres.tar.zst

build-test-artifacts-sqlite:
name: Build test artifacts (sqlite)
runs-on: buildjet-8vcpu-ubuntu-2204
steps:
- uses: rui314/setup-mold@v1

- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
cache-provider: buildjet

- name: Build and archive tests
run: cargo nextest archive --locked --features "embedded-db testing" --workspace --archive-file nextest-archive-sqlite.tar.zst

- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive-sqlite
path: nextest-archive-sqlite.tar.zst

slow-tests-sqlite:
runs-on: ubuntu-latest
needs: build-test-artifacts-sqlite
steps:
# These tests need the `anvil` binary provided by foundry
- name: Install Foundry
Expand All @@ -35,60 +89,39 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Configure Environment
run: PATH="$PWD/target/release:$PATH"

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
- name: Download archive
uses: actions/download-artifact@v4
with:
cache-all-crates: true

- name: Build
run: |
cargo build --locked --bin diff-test --release
cargo nextest run --locked --release --workspace --features embedded-db --no-run
timeout-minutes: 90
name: nextest-archive-sqlite

- name: Slow Test
env:
NEXTEST_PROFILE: slow
run: cargo nextest run --locked --release --workspace --features embedded-db --verbose --no-fail-fast --nocapture
run: cargo nextest run --archive-file nextest-archive-sqlite.tar.zst --verbose --no-fail-fast \
--workspace-remap $PWD
timeout-minutes: 40
slow-tests-postgres:

slow-test-postgres:
needs: build-test-artifacts-postgres
runs-on: ubuntu-latest
steps:
- name: Fix submodule permissions check
run: |
git config --global --add safe.directory '*'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- uses: taiki-e/install-action@nextest
- uses: actions/checkout@v4

- name: Checkout Repository
uses: actions/checkout@v4
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Download archive
uses: actions/download-artifact@v4
with:
submodules: recursive

- name: Configure Environment
run: PATH="$PWD/target/release:$PATH"

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true

- name: Build
run: |
cargo build --locked --bin diff-test --release
cargo nextest run --locked --release --workspace --no-run
timeout-minutes: 90
name: nextest-archive-postgres

- name: Slow Test
env:
NEXTEST_PROFILE: slow
run: cargo nextest run --locked --release --workspace --verbose --no-fail-fast --nocapture
timeout-minutes: 40
run: |
cargo nextest run --archive-file nextest-archive-postgres.tar.zst --verbose --no-fail-fast \
--workspace-remap $PWD
timeout-minutes: 40

0 comments on commit fd7f052

Please sign in to comment.