|
| 1 | +on: |
| 2 | + merge_group: |
| 3 | + pull_request: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + - master |
| 9 | + release: |
| 10 | + types: |
| 11 | + - released |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + Lints: |
| 19 | + name: Check the dist/ folder is up to date |
| 20 | + runs-on: UbuntuLatest32Cores128G |
| 21 | + permissions: |
| 22 | + contents: read |
| 23 | + id-token: write |
| 24 | + steps: |
| 25 | + - uses: actions/checkout@v4 |
| 26 | + - uses: DeterminateSystems/nix-installer-action@main |
| 27 | + with: |
| 28 | + determinate: true |
| 29 | + - uses: DeterminateSystems/flakehub-cache-action@main |
| 30 | + - uses: DeterminateSystems/flake-checker-action@main |
| 31 | + |
| 32 | + - name: Check README links |
| 33 | + if: success() || failure() |
| 34 | + run: nix develop --command lychee README.md |
| 35 | + |
| 36 | + - name: Install pnpm dependencies |
| 37 | + if: success() || failure() |
| 38 | + run: nix develop --command pnpm install |
| 39 | + |
| 40 | + - name: Check formatting |
| 41 | + if: success() || failure() |
| 42 | + run: nix develop --command pnpm run check-fmt |
| 43 | + |
| 44 | + - name: Run ESLint |
| 45 | + if: success() || failure() |
| 46 | + run: nix develop --command pnpm run lint |
| 47 | + |
| 48 | + - name: Build bundle |
| 49 | + if: success() || failure() |
| 50 | + run: nix develop --command pnpm run build |
| 51 | + |
| 52 | + - name: Package as Node.js runnable |
| 53 | + if: success() || failure() |
| 54 | + run: nix develop --command pnpm run package |
| 55 | + |
| 56 | + - name: Check git status |
| 57 | + if: success() || failure() |
| 58 | + run: git status --porcelain=v1 |
| 59 | + |
| 60 | + - name: "Nix formatting" |
| 61 | + if: success() || failure() |
| 62 | + run: git ls-files '*.nix' | nix develop --command xargs nixpkgs-fmt --check |
| 63 | + |
| 64 | + - name: "Rust formatting" |
| 65 | + if: success() || failure() |
| 66 | + run: nix develop --command cargo fmt --check |
| 67 | + |
| 68 | + - name: "Clippy" |
| 69 | + if: success() || failure() |
| 70 | + run: nix develop --command cargo clippy --all-targets --all-features -- -Dwarnings |
| 71 | + |
| 72 | + - name: Ensure no staged changes |
| 73 | + if: success() || failure() |
| 74 | + run: git diff --exit-code |
| 75 | + |
| 76 | + DeterminateCI: |
| 77 | + uses: DeterminateSystems/ci/.github/workflows/workflow.yml@main |
| 78 | + permissions: |
| 79 | + id-token: "write" |
| 80 | + contents: "read" |
| 81 | + with: |
| 82 | + visibility: public |
| 83 | + runner-map: | |
| 84 | + { |
| 85 | + "aarch64-darwin": "namespace-profile-mac-m2-12c28g", |
| 86 | + "aarch64-linux": "UbuntuLatest32Cores128GArm", |
| 87 | + "x86_64-darwin": "namespace-profile-mac-m2-12c28g", |
| 88 | + "x86_64-linux": "UbuntuLatest32Cores128G" |
| 89 | + } |
| 90 | +
|
| 91 | + ProductionTest: |
| 92 | + needs: |
| 93 | + - Lints |
| 94 | + - DeterminateCI |
| 95 | + runs-on: UbuntuLatest32Cores128G |
| 96 | + timeout-minutes: 5 |
| 97 | + permissions: |
| 98 | + id-token: write |
| 99 | + contents: read |
| 100 | + steps: |
| 101 | + - uses: actions/checkout@v4 |
| 102 | + - uses: DeterminateSystems/nix-installer-action@main |
| 103 | + if: ${{ github.event_name == 'merge_group' }} |
| 104 | + with: |
| 105 | + determinate: true |
| 106 | + - uses: DeterminateSystems/flakehub-cache-action@main |
| 107 | + if: ${{ github.event_name == 'merge_group' }} |
| 108 | + |
| 109 | + - run: | |
| 110 | + nix build -j0 .# |
| 111 | + if: ${{ github.event_name == 'merge_group' }} |
| 112 | +
|
| 113 | + - name: Production test |
| 114 | + if: ${{ github.event_name == 'merge_group' }} |
| 115 | + uses: ./ |
| 116 | + with: |
| 117 | + visibility: "hidden" |
| 118 | + rolling-minor: 0 |
| 119 | + rolling: true |
| 120 | + log-directives: "flakehub_push=trace" |
| 121 | + logger: "pretty" |
| 122 | + flakehub-push-binary: ./result/bin/flakehub-push |
| 123 | + _internal-strict-mode: true |
| 124 | + |
| 125 | + PushToIDS: |
| 126 | + needs: ProductionTest |
| 127 | + runs-on: ubuntu-latest |
| 128 | + permissions: |
| 129 | + id-token: "write" |
| 130 | + contents: "read" |
| 131 | + steps: |
| 132 | + - uses: actions/checkout@v4 |
| 133 | + |
| 134 | + - uses: DeterminateSystems/nix-installer-action@main |
| 135 | + with: |
| 136 | + determinate: true |
| 137 | + - uses: DeterminateSystems/flakehub-cache-action@main |
| 138 | + |
| 139 | + - run: | |
| 140 | + mkdir artifacts |
| 141 | +
|
| 142 | + nix build -j0 .#packages.x86_64-linux.default |
| 143 | + cp -r ./result/bin/flakehub-push ./artifacts/X64-Linux |
| 144 | +
|
| 145 | + nix build -j0 .#packages.aarch64-linux.default |
| 146 | + cp -r ./result/bin/flakehub-push ./artifacts/ARM64-Linux |
| 147 | +
|
| 148 | + nix build -j0 .#packages.x86_64-darwin.default |
| 149 | + cp -r ./result/bin/flakehub-push ./artifacts/X64-macOS |
| 150 | +
|
| 151 | + nix build -j0 .#packages.aarch64-darwin.default |
| 152 | + cp -r ./result/bin/flakehub-push ./artifacts/ARM64-macOS |
| 153 | +
|
| 154 | + - uses: DeterminateSystems/push-artifact-ids@main |
| 155 | + with: |
| 156 | + s3_upload_role: ${{ secrets.AWS_S3_UPLOAD_ROLE }} |
| 157 | + bucket: ${{ secrets.AWS_S3_UPLOAD_BUCKET }} |
| 158 | + directory: ./artifacts |
| 159 | + ids_project_name: flakehub-push |
| 160 | + ids_binary_prefix: flakehub-push |
0 commit comments