name: CI
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
build:
name: build (stable)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all -- --check
- name: Clippy (relaxed)
run: |
cargo clippy --workspace --all-targets --all-features -- \
-D clippy::correctness \
-D clippy::perf \
-W clippy::style \
-W clippy::complexity
- name: Build
run: cargo build --workspace --all-targets --locked
- name: Tests
run: cargo test --workspace --all-features --locked -- --nocapture
msrv:
name: build (MSRV)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.83.0
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Build (locked)
run: cargo build --workspace --all-targets --locked
- name: Build all features (locked)
run: cargo build --workspace --all-targets --all-features --locked
- name: Tests all features (locked)
run: cargo test --workspace --all-features --locked -- --nocapture
- name: Check standalone plugin example (locked)
run: cargo check --manifest-path examples/kvstore_plugin/Cargo.toml --locked
- name: Check generated templates
env:
CARGO_TARGET_DIR: ${{ github.workspace }}/target/template-check
run: |
output_dir="$RUNNER_TEMP/thenodes-template-check"
mkdir -p "$output_dir"
for template in cal-app hybrid-app nep-plugin custom-host; do
app_name="ci-${template}"
./templates/generate_app.sh "$app_name" "$template" --output "$output_dir"
cargo fmt --manifest-path "$output_dir/$app_name/Cargo.toml" -- --check
cargo check --manifest-path "$output_dir/$app_name/Cargo.toml"
cargo check --manifest-path "$output_dir/$app_name/Cargo.toml" --locked
done