Skip to content

Commit

Permalink
single test build
Browse files Browse the repository at this point in the history
  • Loading branch information
tbro committed Oct 30, 2024
1 parent 1bb9b6c commit 63f5e3a
Showing 1 changed file with 52 additions and 17 deletions.
69 changes: 52 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,41 @@ concurrency:
cancel-in-progress: true

env:
RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" --cfg hotshot_example'
RUST_LOG: info,libp2p=off,node=error
CARGO_TERM_COLOR: always

jobs:
build-test-artifacts:
name: Build test artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: Install nextest
uses: taiki-e/install-action@nextest

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

- name: Build and archive tests
run: cargo nextest archive --locked --workspace --all-features --archive-file nextest-archive.tar.zst
- name: Upload archive to workflow
uses: actions/upload-artifact@v4
with:
name: nextest-archive
path: nextest-archive.tar.zst

test:
needs: build-test-artifacts
runs-on: ubuntu-latest
env:
RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"'
steps:
- name: Fix submodule permissions check
run: |
Expand All @@ -36,12 +63,19 @@ jobs:
with:
version: nightly

- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

- uses: taiki-e/install-action@nextest
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
Expand All @@ -50,15 +84,12 @@ jobs:
cache-all-crates: true
key: my-temp-key

- name: Build Tests
run: cargo nextest run --locked --workspace --all-features --no-run
timeout-minutes: 30

- name: Test
run: cargo nextest run --locked --workspace --all-features --verbose --no-fail-fast
run: cargo nextest run --archive-file nextest-archive.tar.zst --locked --workspace --all-features --verbose --no-fail-fast
timeout-minutes: 20

test-integration:
needs: build-test-artifacts
strategy:
matrix:
version: [02,03]
Expand All @@ -68,9 +99,6 @@ jobs:
- version: 03
compose: "-f process-compose.yaml -f process-compose-mp.yml -D"
runs-on: ubuntu-latest
env:
# Build test binary with `testing` feature, which requires `hotshot_example` config
RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" --cfg hotshot_example'
steps:
- name: Install Nix
uses: cachix/install-nix-action@V27
Expand All @@ -87,13 +115,20 @@ jobs:
with:
version: nightly

- name: Checkout Repository
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
# By default actions/checkout checks out a merge commit. Check out the PR head instead.
# https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive

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

- name: Download archive
uses: actions/download-artifact@v4
with:
name: nextest-archive

- name: Enable Rust Caching
uses: Swatinem/rust-cache@v2
with:
Expand All @@ -118,7 +153,7 @@ jobs:
env:
NEXTEST_PROFILE: integration
INTEGRATION_TEST_SEQUENCER_VERSION: ${{matrix.version}}
run: cargo nextest run --locked --all-features --verbose --nocapture
run: cargo nextest run --archive-file nextest-archive.tar.zst --locked --all-features --verbose --nocapture
timeout-minutes: 40

- name: Process Compose Down
Expand Down

0 comments on commit 63f5e3a

Please sign in to comment.