Boot-contracts compilation step on CI #1285
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: Continuous Integration | |
on: | |
push: | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
- "**.yml" | |
- "**.yaml" | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
branches: [main] | |
paths-ignore: | |
- "**.md" | |
- "**.yml" | |
- "**.yaml" | |
merge_group: | |
types: [checks_requested] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
fmt: | |
name: Code Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust nightly with rustfmt | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt -- --config group_imports=StdExternalCrate,imports_granularity=Module --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust nightly with clippy | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- run: cargo clippy --no-deps --all-features --all-targets -- -D warnings -D clippy::expect_used -D clippy::unwrap_used -D clippy::unimplemented | |
build-test-artifacts: | |
name: Test Artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: Build and archive tests | |
run: | | |
cargo llvm-cov nextest-archive \ | |
--all-features \ | |
--workspace \ | |
--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 | |
if-no-files-found: error | |
- name: Upload standard.wasm file | |
uses: actions/upload-artifact@v4 | |
with: | |
name: standard.wasm | |
path: ${{github.workspace}}/clar2wasm/src/standard/standard.wasm | |
if-no-files-found: error | |
build: | |
name: Build binaries | |
runs-on: ubuntu-latest | |
needs: [] | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Build binaries | |
run: | | |
cargo build | |
run-tests: | |
name: Run Tests | |
runs-on: ubuntu-latest | |
needs: [fmt, clippy, build-test-artifacts] | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: Download standard.wasm file | |
uses: actions/download-artifact@v4 | |
with: | |
name: standard.wasm | |
path: ${{github.workspace}}/clar2wasm/src/standard/ | |
- name: Download archive | |
uses: actions/download-artifact@v4 | |
with: | |
name: nextest-archive | |
- name: Run tests | |
run: | | |
cargo llvm-cov nextest \ | |
--archive-file nextest-archive.tar.zst | |
compile-boot-contracts: | |
name: Compile boot-contracts | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./clar2wasm | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Compile boot-contracts | |
run: | | |
cargo build --release | |
bash ./scripts/boot-contracts-compile.sh | |
codecov: | |
name: Code Coverage | |
runs-on: ubuntu-latest | |
needs: [fmt, clippy, build-test-artifacts] | |
steps: | |
- name: Checkout PR | |
uses: actions/checkout@v4 | |
- name: Use Rust stable | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Install nextest | |
uses: taiki-e/install-action@nextest | |
- name: Download standard.wasm file | |
uses: actions/download-artifact@v4 | |
with: | |
name: standard.wasm | |
path: ${{github.workspace}}/clar2wasm/src/standard/ | |
- name: Download archive | |
uses: actions/download-artifact@v4 | |
with: | |
name: nextest-archive | |
- name: Run tests and output coverage | |
shell: bash | |
run: | | |
cargo llvm-cov nextest \ | |
--archive-file nextest-archive.tar.zst \ | |
--codecov \ | |
--output-path codecov.json | |
- name: Upload coverage to Codecov | |
uses: codecov/[email protected] | |
with: | |
files: codecov.json | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |