Test CI overhaul #3831
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: Test | |
on: | |
push: | |
branches: | |
- main | |
- release-* | |
tags: | |
# YYYYMMDD | |
- "20[0-9][0-9][0-1][0-9][0-3][0-9]*" | |
schedule: | |
- cron: "0 0 * * 1" | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
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 | |
build-test-bins: | |
name: Build and archive binaries for tests | |
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: Enable Rust Caching | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
cache-all-crates: true | |
- name: Build Bins | |
run: cargo build --locked --profile test --bins | |
timeout-minutes: 30 | |
- name: Upload archive to workflow | |
uses: actions/upload-artifact@v4 | |
with: | |
name: x86_64-unknown-linux-gnu-test-services | |
path: | | |
target/debug/orchestrator | |
target/debug/cdn-broker | |
target/debug/cdn-marshal | |
target/debug/cdn-whitelist | |
target/debug/state-relay-server | |
target/debug/state-prover | |
target/debug/sequencer | |
target/debug/cli | |
target/debug/submit-transactions | |
target/debug/reset-storage | |
target/debug/utils | |
target/debug/deploy | |
target/debug/keygen | |
target/debug/permissionless-builder | |
target/debug/nasty-client | |
target/debug/espresso-dev-node | |
target/debug/pub-key | |
target/debug/espresso-bridge | |
target/debug/marketplace-solver | |
target/debug/marketplace-builder | |
target/debug/node-metrics | |
target/debug/dev-rollup | |
test: | |
needs: build-test-artifacts | |
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: 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: Download archive | |
uses: actions/download-artifact@v4 | |
with: | |
name: nextest-archive | |
- name: Test | |
run: cargo nextest run --archive-file nextest-archive.tar.zst --verbose --no-fail-fast | |
timeout-minutes: 20 | |
test-integration: | |
needs: [build-test-artifacts, build-test-bins] | |
strategy: | |
matrix: | |
version: [02,03] | |
include: | |
- version: 02 | |
compose: "-f process-compose.yaml -D" | |
- version: 03 | |
compose: "-f process-compose.yaml -f process-compose-mp.yml -D" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Nix | |
uses: cachix/install-nix-action@V27 | |
- name: Fix submodule permissions check | |
run: | | |
git config --global --add safe.directory '*' | |
- name: Configure PATH | |
run: PATH="$PWD/target/debug:$PATH" | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
version: nightly | |
- 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 | |
- name: debug | |
run: ls -R | |
- name: Install process-compose | |
run: nix profile install nixpkgs#process-compose | |
- name: Pull Docker Images | |
run: docker compose pull || docker-compose pull | |
- name: Run Demo-Native ${{matrix.version}} | |
run: bash -x scripts/demo-native ${{matrix.compose}} | |
- name: Test Integration | |
env: | |
NEXTEST_PROFILE: integration | |
INTEGRATION_TEST_SEQUENCER_VERSION: ${{matrix.version}} | |
run: cargo nextest run --archive-file nextest-archive.tar.zst --verbose --nocapture --no-fail-fast | |
timeout-minutes: 40 | |
- name: Process Compose Down | |
run: process-compose down | |
demo-native: | |
needs: build-test-bins | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
- name: Install Nix | |
uses: cachix/install-nix-action@V27 | |
- name: Install process-compose | |
run: | | |
nix profile install nixpkgs#process-compose | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Download archive | |
uses: actions/download-artifact@v4 | |
with: | |
name: x86_64-unknown-linux-gnu-test-services | |
path: target/debug | |
- name: Test Demo | |
run: | | |
export PATH="$PWD/target/debug:$PATH" | |
set -o pipefail | |
scripts/demo-native --tui=false & | |
timeout -v 600 scripts/smoke-test-demo | sed -e 's/^/smoke-test: /;' |