mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-05-19 07:29:32 +00:00
119 lines
2.8 KiB
YAML
119 lines
2.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
fmt-rs:
|
|
name: Rust Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install nightly toolchain for rustfmt
|
|
run: rustup install nightly --profile minimal --component rustfmt
|
|
|
|
- name: Check Rust files are formatted
|
|
run: cargo +nightly fmt --all -- --check
|
|
|
|
fmt-toml:
|
|
name: TOML Format
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install taplo-cli
|
|
run: cargo install --locked taplo-cli
|
|
|
|
- name: Check TOML files are formatted
|
|
run: taplo fmt --check .
|
|
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.94.0"
|
|
components: clippy
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Clippy
|
|
run: RISC0_SKIP_BUILD=1 cargo clippy --workspace --all-targets -- -D warnings
|
|
|
|
unit-tests:
|
|
name: Unit Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.94.0"
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Unit tests
|
|
run: cargo test --workspace --exclude integration_tests
|
|
env:
|
|
RISC0_DEV_MODE: 1
|
|
|
|
integration-tests:
|
|
name: Integration Tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: ./.github/actions/install-risc0
|
|
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: "1.94.0"
|
|
|
|
- name: Cache cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
target
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
|
|
- name: Integration tests
|
|
run: cargo test -p integration_tests
|
|
env:
|
|
RISC0_DEV_MODE: 1
|