Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Check Build and Tests #528

Check Build and Tests

Check Build and Tests #528

Workflow file for this run

name: Check Build and Tests
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup worker
uses: "./.github/templates/setup-worker"
with:
rust-components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
check:
needs: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup worker
uses: "./.github/templates/setup-worker"
- name: Cache Build artefacts
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-0_9_37-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-0_9_37
- name: Check Build Trappist node
run: |
SKIP_WASM_BUILD=1 cargo check --release --locked
test-trappist:
needs: lint
runs-on: ubuntu-latest
steps:
# Tests with benchmarks require a lot of disk space
- name: Free Disk Space
uses: "./.github/templates/free-space"
- uses: actions/checkout@v3
- name: Setup worker
uses: "./.github/templates/setup-worker"
- name: Cache Build artefacts
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-debug-trappist-0_9_37-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-debug-trappist-0_9_37
- name: Run Trappist tests
run: |
cargo test --workspace --exclude stout-runtime --no-default-features --features trappist/trappist-runtime,std,runtime-benchmarks --locked --jobs 1
test-stout:
needs: lint
runs-on: ubuntu-latest
steps:
# Tests with benchmarks require a lot of disk space
- name: Free Disk Space
uses: "./.github/templates/free-space"
- uses: actions/checkout@v3
- name: Setup worker
uses: "./.github/templates/setup-worker"
- name: Cache Build artefacts
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-debug-stout-0_9_37-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-debug-stout-0_9_37
- name: Run Stout tests
run: |
cargo test -p stout-runtime -p trappist --no-default-features --features=trappist/stout-runtime,std,runtime-benchmarks --locked --jobs 1