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

Split trappist and stout runtimes with conditional build #524

Split trappist and stout runtimes with conditional build

Split trappist and stout runtimes with conditional build #524

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-${{ hashFiles('**/Cargo.lock') }}
- name: Check Build Trappist node
run: |
cargo check -p trappist --release --locked
test-trappist:
needs: lint
runs-on: ubuntu-latest
steps:
# Tests with benchmarks require a lot of disk space
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
android: true
dotnet: true
haskell: false
large-packages: false
swap-storage: false
- 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-${{ hashFiles('**/Cargo.lock') }}
- name: Run Trappist tests
run: |
SKIP_WASM_BUILD=1 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 (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
android: true
dotnet: true
haskell: false
large-packages: false
swap-storage: false
- 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-${{ hashFiles('**/Cargo.lock') }}
- name: Run Stout tests
run: |
SKIP_WASM_BUILD=1 cargo test -p stout-runtime -p trappist --no-default-features --features=trappist/stout-runtime,std,runtime-benchmarks --locked --jobs 1