ci: pull from firefly-turnkey in setup-nix action #205
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| # Cancel in-progress runs on new pushes to same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| # =========================================================================== | |
| # Tier 1: Syntax & Lint (fast-fail, ~30s) | |
| # =========================================================================== | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Nix | |
| uses: ./.github/actions/setup-nix | |
| - name: Check flake syntax | |
| run: nix flake check --no-build --impure | |
| # =========================================================================== | |
| # Tier 2: Build Verification (~90s) | |
| # =========================================================================== | |
| build-prelude: | |
| name: Build Prelude | |
| runs-on: ubuntu-latest | |
| needs: [lint] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Nix | |
| uses: ./.github/actions/setup-nix | |
| - name: Build turnkey-prelude | |
| run: nix build .#turnkey-prelude --no-link | |
| build-tools: | |
| name: Build Tools | |
| runs-on: ubuntu-latest | |
| needs: [lint] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Nix | |
| uses: ./.github/actions/setup-nix | |
| - name: Build tk | |
| run: nix build .#tk --no-link | |
| - name: Build godeps-gen | |
| run: nix build .#godeps-gen --no-link | |
| - name: Build rustdeps-gen | |
| run: nix build .#rustdeps-gen --no-link | |
| - name: Build pydeps-gen | |
| run: nix build .#pydeps-gen --no-link | |
| - name: Build jsdeps-gen | |
| run: nix build .#jsdeps-gen --no-link | |
| # =========================================================================== | |
| # Summary job for branch protection | |
| # =========================================================================== | |
| ci-success: | |
| name: CI Success | |
| runs-on: ubuntu-latest | |
| needs: [lint, build-prelude, build-tools] | |
| if: always() | |
| steps: | |
| - name: Check required jobs | |
| run: | | |
| check_result() { | |
| local result="$1" | |
| [[ "$result" == "success" ]] | |
| } | |
| failed=false | |
| check_result "${{ needs.lint.result }}" || failed=true | |
| check_result "${{ needs.build-prelude.result }}" || failed=true | |
| check_result "${{ needs.build-tools.result }}" || failed=true | |
| if [[ "$failed" == "true" ]]; then | |
| echo "One or more required jobs failed" | |
| exit 1 | |
| fi | |
| echo "All required jobs passed!" |