Skip to content

Work/from main next #436

Work/from main next

Work/from main next #436

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
CARGO_NET_OFFLINE: false
DYLINT_VERSION: "4.1.0"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Format check (fastest, prerequisite for other jobs)
format:
name: Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Setup Rust toolchain (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-15
components: rustfmt
- name: Setup Cargo cache
uses: Swatinem/rust-cache@v2
- name: Check formatting
run: ./scripts/ci-check.sh lint
# Lint checks
lint:
name: Lint Check
runs-on: ubuntu-latest
needs: format
strategy:
matrix:
check:
- name: Clippy
script: clippy
- name: Dylint
script: dylint
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Setup Rust toolchain (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-15
components: clippy
- name: Setup Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: lint
cache-directories: ~/.cargo/bin
- name: Run ${{ matrix.check.name }}
run: ./scripts/ci-check.sh ${{ matrix.check.script }}
# Build and test
test:
name: Test (${{ matrix.target.name }})
runs-on: ubuntu-latest
needs: format
strategy:
fail-fast: false
matrix:
target:
- name: no_std
script: no-std
- name: std
script: std
- name: workspace
script: test
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Setup Rust toolchain (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-15
- name: Setup Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: test-${{ matrix.target.name }}
- name: Run ${{ matrix.target.name }} tests
run: ./scripts/ci-check.sh ${{ matrix.target.script }}
# Documentation build
docs:
name: Documentation
runs-on: ubuntu-latest
needs: format
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Setup Rust toolchain (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-15
- name: Setup Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: docs
- name: Build documentation
run: ./scripts/ci-check.sh doc
# Examples build
examples:
name: Examples
runs-on: ubuntu-latest
needs: format
steps:
- name: Checkout source
uses: actions/checkout@v6
- name: Setup Rust toolchain (nightly)
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2025-02-15
- name: Setup Cargo cache
uses: Swatinem/rust-cache@v2
with:
shared-key: examples
- name: Build examples
run: ./scripts/ci-check.sh examples
# All jobs completion check
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs:
- format
- lint
- test
- docs
- examples
steps:
- name: All checks passed
run: echo "✅ All CI checks passed successfully"