Skip to content

Add Github Action cache to improve CI time #1136

Add Github Action cache to improve CI time

Add Github Action cache to improve CI time #1136

Workflow file for this run

name: CI
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
push:
branches:
- main
jobs:
check-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tooling and use Rust cache
uses: ./.github/actions/rust-cache
- run: cargo fmt --all --check
- run: cargo check -p example --target=riscv32i-unknown-none-elf
- run: cargo check --bins --examples --tests --benches --all-features
cargo-test:
needs: check-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tooling and use Rust cache
uses: ./.github/actions/rust-cache
- run: cargo test --bins --examples --all-features
test-smoke:
needs: check-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tooling and use Rust cache
uses: ./.github/actions/rust-cache
- run: assets/scripts/smoke.sh examples/src/bin/fib3_profiling.rs
- run: assets/scripts/smoke.sh examples/src/bin/hello.rs
test-sdk:
needs: check-build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install tooling and use Rust cache
uses: ./.github/actions/rust-cache
- run: assets/scripts/test_sdk.sh examples/src/bin/hello.rs
detect-unused-crate:
runs-on: ubuntu-latest
steps:
- uses: bnjbvr/cargo-machete@main
bench-riscv:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- uses: actions/checkout@v4
- name: Install valgrind
run: sudo apt-get install -y valgrind
- name: Install iai-callgrind-runner
run: |
version=$(cargo metadata --format-version=1 |\
jq '.packages[] | select(.name == "iai-callgrind").version' |\
tr -d '"'
)
cargo install iai-callgrind-runner --version $version
- name: Run benchmarks
run: |
cargo bench --bench riscv_machine