Skip to content

Commit 8c5bfbb

Browse files
committed
WIP
1 parent 3364d66 commit 8c5bfbb

File tree

11 files changed

+324
-186
lines changed

11 files changed

+324
-186
lines changed

.github/workflows/eval.yml

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ permissions:
66
contents: read
77

88
jobs:
9-
tests:
10-
name: eval-check
9+
attrs:
10+
name: Attrs
1111
runs-on: ubuntu-latest
12-
strategy:
13-
matrix:
14-
system: [x86_64-linux, aarch64-linux, aarch64-darwin, x86_64-darwin]
12+
outputs:
13+
systems: ${{ steps.systems.outputs.systems }}
14+
mergedSha: ${{ steps.merged.outputs.mergedSha }}
1515
steps:
1616
# Important: Because of `pull_request_target`, this doesn't check out the PR,
1717
# but rather the base branch of the PR, which is needed so we don't run untrusted code
@@ -20,26 +20,66 @@ jobs:
2020
path: base
2121
sparse-checkout: ci
2222
- name: Resolving the merge commit
23+
id: merged
2324
env:
2425
GH_TOKEN: ${{ github.token }}
2526
run: |
2627
if mergedSha=$(base/ci/get-merge-commit.sh ${{ github.repository }} ${{ github.event.number }}); then
2728
echo "Checking the merge commit $mergedSha"
28-
echo "mergedSha=$mergedSha" >> "$GITHUB_ENV"
29+
echo "mergedSha=$mergedSha" >> "$GITHUB_OUTPUT"
2930
else
3031
# Skipping so that no notifications are sent
3132
echo "Skipping the rest..."
3233
fi
3334
rm -rf base
3435
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3536
# Add this to _all_ subsequent steps to skip them
36-
if: env.mergedSha
37+
if: steps.merged.mergedSha
3738
with:
3839
ref: ${{ env.mergedSha }}
40+
path: nixpkgs
41+
42+
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
43+
if: outputs.merged.mergedSha
44+
45+
- id: systems
46+
if: steps.merged.mergedSha
47+
run: |
48+
nix-build nixpkgs/ci -A eval.evalPlan
49+
echo "systems=$(<result/systems.json)" > "GITHUB_OUTPUT"
50+
51+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 v4.4.3
52+
if: steps.merged.mergedSha
53+
with:
54+
name: eval-plan
55+
path: result/systems
56+
57+
eval:
58+
name: Eval
59+
runs-on: ubuntu-latest
60+
needs: attrs
61+
if: needs.attrs.outputs.mergedSha
62+
strategy:
63+
matrix:
64+
system: ${{ fromJSON(needs.attrs.outputs.systems) }}
65+
steps:
66+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
67+
with:
68+
name: eval-plan
69+
path: systems
70+
71+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
72+
with:
73+
ref: ${{ needs.attrs.outputs.mergedSha }}
74+
path: nixpkgs
3975

4076
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30
41-
if: env.mergedSha
4277

4378
- name: Check eval
44-
if: env.mergedSha
45-
run: ./ci/eval-nixpkgs.sh --system "${{ matrix.system }}"
79+
run: nix-build nixpkgs/ci -A eval.singleJob --arg jobDir systems/${{ matrix.system }}
80+
81+
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 v4.4.3
82+
if: outputs.merged.mergedSha
83+
with:
84+
name: result-${ matrix.system }}
85+
path: result/paths

ci/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ in
2626
inherit pkgs;
2727
requestReviews = pkgs.callPackage ./request-reviews { };
2828
codeownersValidator = pkgs.callPackage ./codeowners-validator { };
29+
eval = pkgs.callPackage ./eval { };
2930
}

ci/eval-nixpkgs.sh

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)