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

Commit

Permalink
split trappist and stout runtimes with conditional build
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaninja committed Jun 27, 2023
1 parent 35a8421 commit 1598120
Show file tree
Hide file tree
Showing 14 changed files with 419 additions and 310 deletions.
23 changes: 23 additions & 0 deletions .github/templates/free-space/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: free-space
description: |
This action frees up disk space on the runner.
runs:
using: "composite"

steps:
- name: Remove Android library
shell: bash
run: sudo rm -rf /usr/local/lib/android

- name: Remove .NET runtime
shell: bash
run: sudo rm -rf /usr/share/dotnet

- name: Remove CodeQL
shell: bash
run: sudo rm -rf /opt/hostedtoolcache/CodeQL

- name: Removes cached Docker images
shell: bash
run: sudo docker image prune --all --force
5 changes: 0 additions & 5 deletions .github/templates/setup-worker/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ description: |
This action sets up a worker for use in other actions. It installs the
necessary dependencies for building the project.
inputs:
rust-components:
description: Comma-separated list of components to be additionally installed for a new rust toolchain
required: false

runs:
using: "composite"

Expand Down
55 changes: 39 additions & 16 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,49 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-release-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release
key: ${{ runner.os }}-cargo-release-0_9_37-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-release-0_9_37

- name: Check Build Trappist Runtime
- name: Check Build Trappist node
run: |
SKIP_WASM_BUILD=1 cargo check --release
SKIP_WASM_BUILD=1 cargo check --release --locked
test:
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
- 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:
android: true
dotnet: true
haskell: false
large-packages: false
swap-storage: false
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

Expand All @@ -77,9 +100,9 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-debug-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-debug
key: ${{ runner.os }}-cargo-debug-stout-0_9_37-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-debug-stout-0_9_37

- name: Run tests
- name: Run Stout tests
run: |
cargo test --features runtime-benchmarks --jobs 1
cargo test -p stout-runtime -p trappist --no-default-features --features=trappist/stout-runtime,std,runtime-benchmarks --locked --jobs 1
Loading

0 comments on commit 1598120

Please sign in to comment.