|
| 1 | +name: Run checks and tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +concurrency: |
| 12 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 13 | + cancel-in-progress: true |
| 14 | + |
| 15 | +env: |
| 16 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 17 | + CARGO_INCREMENTAL: 0 |
| 18 | + CARGO_TERM_COLOR: always |
| 19 | + NIX_SIGNING_PUBLIC_KEY: "ellipsis-labs:eug33YU0s2/K/BgiOtEta1cwNIzERtIybNATLOBsrEA=" |
| 20 | + NIX_CACHE_URI: "s3://atlas-nix-cache?compression=zstd¶llel-compression=true&endpoint=6a2b885167c20bd5dd1d3bcb4b09760f.r2.cloudflarestorage.com" |
| 21 | + |
| 22 | +jobs: |
| 23 | + check: |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + strategy: |
| 26 | + matrix: |
| 27 | + os: [ubuntu-latest, macos-latest] |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + - uses: ./.github/actions/rust-cache |
| 31 | + with: |
| 32 | + cache-name: check |
| 33 | + - uses: ./.github/actions/cargo-binstall |
| 34 | + with: |
| 35 | + binaries: cargo-hold |
| 36 | + - run: cargo hold voyage |
| 37 | + - run: cargo check --locked --all-targets |
| 38 | + |
| 39 | + test: |
| 40 | + runs-on: ${{ matrix.os }} |
| 41 | + needs: [check] |
| 42 | + strategy: |
| 43 | + matrix: |
| 44 | + os: [ubuntu-latest, macos-latest] |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + - uses: ./.github/actions/rust-cache |
| 48 | + with: |
| 49 | + cache-name: test |
| 50 | + - uses: ./.github/actions/cargo-binstall |
| 51 | + with: |
| 52 | + binaries: cargo-nextest cargo-hold |
| 53 | + - run: cargo hold voyage |
| 54 | + - run: cargo nextest run --locked --profile ci |
| 55 | + |
| 56 | + doctest: |
| 57 | + runs-on: ${{ matrix.os }} |
| 58 | + needs: [check] |
| 59 | + strategy: |
| 60 | + matrix: |
| 61 | + os: [ubuntu-latest, macos-latest] |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v4 |
| 64 | + - uses: ./.github/actions/rust-cache |
| 65 | + with: |
| 66 | + cache-name: doctest |
| 67 | + - uses: ./.github/actions/cargo-binstall |
| 68 | + with: |
| 69 | + binaries: cargo-hold |
| 70 | + - run: cargo hold voyage |
| 71 | + - run: cargo test --locked --doc |
| 72 | + |
| 73 | + clippy: |
| 74 | + runs-on: ubuntu-latest |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v4 |
| 77 | + - uses: ./.github/actions/rust-cache |
| 78 | + with: |
| 79 | + cache-name: clippy |
| 80 | + - uses: ./.github/actions/cargo-binstall |
| 81 | + with: |
| 82 | + binaries: cargo-hold |
| 83 | + - run: rustup toolchain install nightly-2025-07-08 --component clippy |
| 84 | + - run: cargo hold voyage |
| 85 | + - run: cargo +nightly-2025-07-08 clippy --all-targets -- -D warnings |
| 86 | + |
| 87 | + fmt: |
| 88 | + runs-on: ubuntu-latest |
| 89 | + steps: |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + - run: rustup toolchain install nightly-2025-07-08 --component rustfmt |
| 92 | + - run: cargo +nightly-2025-07-08 fmt --check |
| 93 | + |
| 94 | + deny: |
| 95 | + runs-on: ubuntu-latest |
| 96 | + steps: |
| 97 | + - uses: actions/checkout@v4 |
| 98 | + - uses: ./.github/actions/cargo-binstall |
| 99 | + with: |
| 100 | + binaries: cargo-deny |
| 101 | + - run: cargo deny check |
| 102 | + |
| 103 | + audit: |
| 104 | + runs-on: ubuntu-latest |
| 105 | + steps: |
| 106 | + - uses: actions/checkout@v4 |
| 107 | + - uses: ./.github/actions/cargo-binstall |
| 108 | + with: |
| 109 | + binaries: cargo-audit |
| 110 | + - run: cargo audit |
| 111 | + |
| 112 | + cross-build: |
| 113 | + needs: [test, doctest, clippy, fmt, deny, audit] |
| 114 | + uses: ./.github/workflows/cross-build.yaml |
| 115 | + secrets: |
| 116 | + R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} |
| 117 | + R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} |
| 118 | + NIX_SIGNING_KEY: ${{ secrets.NIX_SIGNING_KEY }} |
| 119 | + |
| 120 | + all-checks-passed: |
| 121 | + needs: [check, test, doctest, clippy, fmt, deny, audit, cross-build] |
| 122 | + runs-on: ubuntu-latest |
| 123 | + steps: |
| 124 | + - run: echo "All checks passed" |
0 commit comments