Unverified Commit 7fd771ee authored by Jörg Thalheim's avatar Jörg Thalheim Committed by GitHub
Browse files

ci: allow running jobs locally (#404466)

parents 88f1d5cf 101a271e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -30,4 +30,4 @@ jobs:
      - uses: cachix/install-nix-action@526118121621777ccd86f79b04685a9319637641 # v31

      - name: Build shell
        run: nix-build shell.nix
        run: nix-build ci -A shell
+1 −1
Original line number Diff line number Diff line
@@ -28,4 +28,4 @@ jobs:

      - name: Building Nixpkgs lib-tests
        run: |
          nix-build --arg pkgs "(import ./ci/. {}).pkgs" ./lib/tests/release.nix
          nix-build ci -A lib-tests
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ jobs:

      - name: Build NixOS manual
        id: build-manual
        run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true nixos/release.nix -A manual.${{ matrix.system }}
        run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true ci -A manual --argstr system ${{ matrix.system }}

      - name: Upload NixOS manual
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+1 −1
Original line number Diff line number Diff line
@@ -32,4 +32,4 @@ jobs:
          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'

      - name: Building Nixpkgs manual
        run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true pkgs/top-level/release.nix -A manual -A manual.tests
        run: NIX_PATH=nixpkgs=$(pwd) nix-build --option restrict-eval true ci -A manual-nixpkgs -A manual-nixpkgs-tests
+3 −19
Original line number Diff line number Diff line
@@ -15,18 +15,6 @@ jobs:
    needs: get-merge-commit
    if: "needs.get-merge-commit.outputs.mergedSha && !contains(github.event.pull_request.title, '[skip treewide]')"
    steps:
      - name: Get list of changed files from PR
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          gh api \
            repos/${{ github.repository }}/pulls/${{github.event.number}}/files --paginate \
            | jq --raw-output '.[] | select(.status != "removed" and (.filename | endswith(".nix"))) | .filename' \
            > "$HOME/changed_files"
          if [[ -s "$HOME/changed_files" ]]; then
            echo "CHANGED_FILES=$HOME/changed_files" > "$GITHUB_ENV"
          fi

      - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          ref: ${{ needs.get-merge-commit.outputs.mergedSha }}
@@ -37,11 +25,7 @@ jobs:
          extra_nix_config: sandbox = true
          nix_path: nixpkgs=channel:nixpkgs-unstable

      - name: Parse all changed or added nix files
      - name: Parse all nix files
        run: |
          ret=0
          while IFS= read -r file; do
            out="$(nix-instantiate --parse "$file")" || { echo "$out" && ret=1; }
          done < "$HOME/changed_files"
          exit "$ret"
        if: ${{ env.CHANGED_FILES && env.CHANGED_FILES != '' }}
          # Tests multiple versions at once, let's make sure all of them run, so keep-going.
          nix-build ci -A parse --keep-going
Loading