chore: Update code analysis #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Restrict permissions to minimum required | |
| permissions: | |
| contents: read | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/devcontainers/rust:1-bullseye | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v30 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Setup FlakeHub Cache | |
| uses: DeterminateSystems/flakehub-cache-action@v7 | |
| with: | |
| cache-name: "singularity-analysis" | |
| visibility: "public" | |
| env: | |
| FLAKEHUB_PUSH_TOKEN: ${{ secrets.FLAKEHUB_PUSH_TOKEN }} | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: mikkihugo | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check compilation | |
| run: cargo check --all-targets | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/devcontainers/rust:1-bullseye | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v30 | |
| with: | |
| nix_path: nixpkgs=channel:nixos-unstable | |
| - name: Setup FlakeHub Cache | |
| uses: DeterminateSystems/flakehub-cache-action@v7 | |
| with: | |
| cache-name: "singularity-analysis" | |
| visibility: "public" | |
| env: | |
| FLAKEHUB_PUSH_TOKEN: ${{ secrets.FLAKEHUB_PUSH_TOKEN }} | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: mikkihugo | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo test --lib --verbose | |
| fmt: | |
| name: Rustfmt | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/devcontainers/rust:1-bullseye | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| clippy: | |
| name: Clippy (Strict) | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/devcontainers/rust:1-bullseye | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run clippy with strictest settings | |
| run: | | |
| cargo clippy --workspace --all-targets --all-features -- \ | |
| -D warnings \ | |
| -D clippy::all \ | |
| -D clippy::pedantic \ | |
| -D clippy::nursery \ | |
| -D clippy::cargo \ | |
| -W clippy::restriction \ | |
| -A clippy::missing_docs_in_private_items \ | |
| -A clippy::implicit_return \ | |
| -A clippy::missing_inline_in_public_items \ | |
| -A clippy::question_mark_used \ | |
| -A clippy::mod_module_files \ | |
| -A clippy::self_named_module_files | |
| build: | |
| name: Build Release | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/devcontainers/rust:1-bullseye | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build release | |
| run: cargo build --release --lib | |
| grammar-sync: | |
| name: Grammar Sync | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/devcontainers/rust:1-bullseye | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Verify generated enums are current | |
| run: ./scripts/check-grammar-sync.sh |