|
| 1 | +# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +name: Rust Cache |
| 5 | + |
| 6 | +# Branch Checks never runs on main, so this saves the rust-checks cache that PR |
| 7 | +# mirrors and merge groups restore. Keep env and build commands aligned with |
| 8 | +# the Branch Checks rust-test job so the cache keys and contents match. |
| 9 | +on: |
| 10 | + push: |
| 11 | + branches: |
| 12 | + - main |
| 13 | + workflow_dispatch: |
| 14 | + |
| 15 | +env: |
| 16 | + CARGO_TERM_COLOR: always |
| 17 | + CARGO_INCREMENTAL: "0" |
| 18 | + MISE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 19 | + |
| 20 | +permissions: |
| 21 | + contents: read |
| 22 | + packages: read |
| 23 | + |
| 24 | +concurrency: |
| 25 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 26 | + # Let runs finish so frequent merges cannot keep cancelling the save. |
| 27 | + cancel-in-progress: false |
| 28 | + |
| 29 | +jobs: |
| 30 | + rust-checks: |
| 31 | + name: Rust checks cache (${{ matrix.system }}) |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + include: |
| 36 | + - runner: linux-amd64-cpu8 |
| 37 | + system: x86_64-linux |
| 38 | + - runner: linux-arm64-cpu8 |
| 39 | + system: aarch64-linux |
| 40 | + - runner: macos-15-xlarge |
| 41 | + system: aarch64-darwin |
| 42 | + runs-on: ${{ matrix.runner }} |
| 43 | + timeout-minutes: 45 |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 46 | + with: |
| 47 | + persist-credentials: false |
| 48 | + |
| 49 | + - uses: ./.github/actions/setup-nix |
| 50 | + with: |
| 51 | + prepare-shell: "true" |
| 52 | + cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 53 | + |
| 54 | + - id: rust |
| 55 | + uses: ./.github/actions/setup-rust |
| 56 | + with: |
| 57 | + cache-key: rust-checks-v2 |
| 58 | + save-cache: "true" |
| 59 | + |
| 60 | + - name: Build tests |
| 61 | + if: steps.rust.outputs.cache-hit != 'true' |
| 62 | + shell: nix develop -c bash -euo pipefail {0} |
| 63 | + run: | |
| 64 | + cargo test --locked -p openshell-crypto --no-default-features --test independent_backend --no-run |
| 65 | + cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support --no-run |
| 66 | + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --no-run |
| 67 | + cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml --no-run |
0 commit comments