fix(ci): correct topo order in publish workflow; add missing neuron-e… #76
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
| # This workflow exposes a single required status context named "ci" via the final aggregator job. | |
| # Purpose: branch protection requires the context "ci". The aggregator job depends on all | |
| # real jobs and fails if any fail. It adds no extra checks; it provides a stable required | |
| # context so protection rules don't need updates when jobs change. | |
| name: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTFLAGS: -Dwarnings | |
| jobs: | |
| check: | |
| name: Check (Nix) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Format check | |
| run: nix develop --command bash -lc "nix fmt && git diff --exit-code" | |
| - name: Test | |
| run: nix develop --command cargo test --workspace | |
| - name: Clippy | |
| run: nix develop --command cargo clippy --workspace --all-features -- -D warnings | |
| - name: Doc | |
| run: nix develop --command cargo doc --workspace --no-deps | |
| check-cargo: | |
| name: Check (Cargo) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy, rustfmt | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Format check | |
| run: cargo fmt --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-features -- -D warnings | |
| - name: Test | |
| run: cargo test --workspace | |
| - name: Doc | |
| run: cargo doc --workspace --no-deps | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Install tarpaulin | |
| run: cargo install cargo-tarpaulin | |
| - name: Generate coverage | |
| run: cargo tarpaulin --workspace --out xml --output-dir coverage/ | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage/cobertura.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| security: | |
| name: Security audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: rustsec/audit-check@v2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| deny: | |
| name: Dependency check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: EmbarkStudios/cargo-deny-action@v2 | |
| with: | |
| rust-version: stable | |
| links: | |
| name: Link check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Check links | |
| uses: lycheeverse/lychee-action@v1 | |
| with: | |
| args: --verbose --no-progress --config .lychee.toml '**/*.md' | |
| fail: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| msrv: | |
| name: MSRV check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: "1.90" | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check | |
| run: cargo check --workspace | |
| ci: | |
| name: ci | |
| runs-on: ubuntu-latest | |
| if: ${{ always() }} | |
| needs: [check, check-cargo, coverage, security, deny, links, msrv] | |
| steps: | |
| - name: Aggregate required checks | |
| env: | |
| CHECK: ${{ needs.check.result }} | |
| CHECK_CARGO: ${{ needs.check-cargo.result }} | |
| COVERAGE: ${{ needs.coverage.result }} | |
| SECURITY: ${{ needs.security.result }} | |
| DENY: ${{ needs.deny.result }} | |
| LINKS: ${{ needs.links.result }} | |
| MSRV: ${{ needs.msrv.result }} | |
| run: | | |
| echo "check=$CHECK" | |
| echo "check-cargo=$CHECK_CARGO" | |
| echo "coverage=$COVERAGE" | |
| echo "security=$SECURITY" | |
| echo "deny=$DENY" | |
| echo "links=$LINKS" | |
| echo "msrv=$MSRV" | |
| for s in "$CHECK" "$CHECK_CARGO" "$COVERAGE" "$SECURITY" "$DENY" "$LINKS" "$MSRV"; do | |
| if [ "$s" != "success" ]; then | |
| echo "One or more required jobs did not succeed" | |
| exit 1 | |
| fi | |
| done | |
| echo "All required jobs succeeded" |