Migrate simple example from Polkadot-sdk repo #343
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: Cargo Build & Test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-Dwarnings" | |
jobs: | |
build: | |
name: Zombienet SDK - latest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Init nigthly install for fmt | |
run: rustup update nightly && rustup default nightly && rustup component add rustfmt | |
- name: Check format | |
run: cargo +nightly fmt --check --all | |
- name: Init install | |
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy | |
- name: Clippy | |
run: cargo clippy --all-targets --all-features | |
- name: Build | |
run: cargo build | |
- name: Tests (except provider crate) | |
run: cargo test --workspace --exclude provider | |
- name: Tests (provider crate) | |
# there should be a unique test thread for native provider tests (asserting spawned processes count) | |
run: cargo test -p provider -- --test-threads 1 | |
coverage: | |
name: Zombienet SDK - coverage | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.event_name == 'pull_request' | |
permissions: | |
issues: write | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install latest nextest release | |
uses: taiki-e/install-action@nextest | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Collect coverage data | |
# there should be a unique test thread for native provider tests (asserting spawned processes count) | |
run: cargo llvm-cov nextest -j 1 --lcov --output-path lcov.info | |
- name: Report code coverage | |
uses: Nef10/[email protected] | |
with: | |
lcov-file: lcov.info | |
pr-number: ${{ github.event.pull_request.number }} |