|
| 1 | +name: Rust CI |
| 2 | +on: |
| 3 | + pull_request: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - prod |
| 9 | + tags: |
| 10 | + - '**' |
| 11 | + |
| 12 | +permissions: |
| 13 | + read: true |
| 14 | + |
| 15 | +jobs: |
| 16 | + fmt: |
| 17 | + name: Format |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1 |
| 21 | + with: |
| 22 | + token: ${{ secrets.GIT_HUB_TOKEN }} |
| 23 | + - uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4 |
| 24 | + with: |
| 25 | + github_access_token: ${{ secrets.GIT_HUB_TOKEN }} |
| 26 | + - uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15 |
| 27 | + continue-on-error: true |
| 28 | + with: |
| 29 | + name: worldcoin |
| 30 | + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 31 | + - name: Print environment |
| 32 | + run: | |
| 33 | + uname -a |
| 34 | + nix develop -c env |
| 35 | +
|
| 36 | + - name: Check Rust formatting |
| 37 | + run: cargo fmt --check --all |
| 38 | + |
| 39 | + clippy: |
| 40 | + name: Clippy |
| 41 | + runs-on: ubuntu-24.04 |
| 42 | + steps: |
| 43 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1 |
| 44 | + with: |
| 45 | + token: ${{ secrets.GIT_HUB_TOKEN }} |
| 46 | + - uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4 |
| 47 | + with: |
| 48 | + github_access_token: ${{ secrets.GIT_HUB_TOKEN }} |
| 49 | + - uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15 |
| 50 | + continue-on-error: true |
| 51 | + with: |
| 52 | + name: worldcoin |
| 53 | + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 54 | + - name: Authorize private git repos |
| 55 | + run: git config --global url."https://${{ secrets.ORB_GIT_HUB_TOKEN }}@github.com".insteadOf https://github.com |
| 56 | + - name: Cache cargo dependencies |
| 57 | + uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # pin@v2.8.0 |
| 58 | + with: |
| 59 | + key: custom-${{ hashFiles('**/*.nix', 'flake.lock') }} |
| 60 | + - name: Print environment |
| 61 | + run: | |
| 62 | + uname -a |
| 63 | + nix develop -c env |
| 64 | +
|
| 65 | + - name: Clippy lints |
| 66 | + run: | |
| 67 | + nix develop -c \ |
| 68 | + cargo clippy --all --all-features --all-targets --no-deps -- -D warnings |
| 69 | +
|
| 70 | + cargo-deny: |
| 71 | + name: Cargo Deny |
| 72 | + runs-on: ubuntu-24.04 |
| 73 | + steps: |
| 74 | + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1 |
| 75 | + with: |
| 76 | + token: ${{ secrets.GIT_HUB_TOKEN }} |
| 77 | + - uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4 |
| 78 | + with: |
| 79 | + github_access_token: ${{ secrets.GIT_HUB_TOKEN }} |
| 80 | + - uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15 |
| 81 | + continue-on-error: true |
| 82 | + with: |
| 83 | + name: worldcoin |
| 84 | + authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} |
| 85 | + - name: Authorize private git repos |
| 86 | + run: git config --global url."https://${{ secrets.GIT_HUB_TOKEN }}@github.com".insteadOf https://github.com |
| 87 | + - name: Print environment |
| 88 | + run: | |
| 89 | + uname -a |
| 90 | + nix develop -c env |
| 91 | +
|
| 92 | + - name: Check licenses |
| 93 | + run: | |
| 94 | + nix develop -c \ |
| 95 | + cargo deny check licenses |
| 96 | +
|
| 97 | + - name: Check security advisories |
| 98 | + run: | |
| 99 | + nix develop -c \ |
| 100 | + cargo deny check advisories |
0 commit comments