@@ -83,16 +83,30 @@ jobs:
83
83
fetch_cmd_aarch64-linux : ${{ steps.report.outputs.fetch_cmd_aarch64-linux }}
84
84
fetch_cmd_x86_64-darwin : ${{ steps.report.outputs.fetch_cmd_x86_64-darwin }}
85
85
fetch_cmd_aarch64-darwin : ${{ steps.report.outputs.fetch_cmd_aarch64-darwin }}
86
+
86
87
steps :
87
88
- name : prepare /nix
88
89
run : sudo mkdir /mnt/nix && sudo mount -m -o bind /mnt/nix /nix
89
90
if : ${{ matrix.system == 'x86_64-linux' || matrix.system == 'aarch64-linux' }}
91
+
90
92
- name : install nix
91
93
uses : DeterminateSystems/nix-installer-action@v16
94
+
95
+ - name : install packages
96
+ run : |
97
+ pkgs=(coreutils nixpkgs-review)
98
+ if [[ ${{ inputs.attic && vars.ATTIC_SERVER != '' && vars.ATTIC_CACHE != '' }} = true ]]; then
99
+ pkgs+=(attic-client)
100
+ fi
101
+ args=()
102
+ for pkg in ${pkgs[@]}; do args+=("github:nixos/nixpkgs/nixos-unstable#$pkg"); done
103
+ nix profile install ${args[@]}
104
+
92
105
- name : clone nixpkgs
93
106
uses : actions/checkout@v4
94
107
with :
95
108
repository : NixOS/nixpkgs
109
+
96
110
- name : wait for upstream eval
97
111
if : ${{ inputs.upstream-eval-timeout > 0 && !inputs.local-eval }}
98
112
env :
@@ -108,9 +122,10 @@ jobs:
108
122
if [[ "$status" = "SUCCESS" ]]; then break; fi
109
123
sleep 10
110
124
done
125
+
111
126
- name : run nixpkgs-review
112
127
run : |
113
- nix run github:nixos/nixpkgs/nixos-unstable# nixpkgs-review -- \
128
+ nixpkgs-review -- \
114
129
pr ${{ inputs.pr }} \
115
130
--eval ${{ inputs.local-eval && 'local' || 'auto' }} \
116
131
--no-shell \
@@ -120,16 +135,15 @@ jobs:
120
135
|| true
121
136
env :
122
137
GITHUB_TOKEN : ${{ github.token }}
138
+
123
139
- name : push results to attic
124
140
if : ${{ inputs.attic && vars.ATTIC_SERVER != '' && vars.ATTIC_CACHE != '' }}
125
141
run : |
126
142
set -ex
127
- attic=$(nix build --no-link --print-out-paths github:nixos/nixpkgs/nixos-unstable#attic-client)/bin/attic
128
- realpath=$(nix build --no-link --print-out-paths github:nixos/nixpkgs/nixos-unstable#coreutils)/bin/realpath
129
- $attic login default "$ATTIC_SERVER" "$ATTIC_TOKEN"
130
- $attic cache info "$ATTIC_CACHE"
131
- ($realpath -qe ~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/results/* || true) > paths
132
- $attic push --stdin "$ATTIC_CACHE" < paths
143
+ attic login default "$ATTIC_SERVER" "$ATTIC_TOKEN"
144
+ attic cache info "$ATTIC_CACHE"
145
+ (realpath -qe ~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/results/* || true) > paths
146
+ attic push --stdin "$ATTIC_CACHE" < paths
133
147
info=$(curl -f -H "Authorization: Bearer ${ATTIC_TOKEN}" "${ATTIC_SERVER}_api/v1/cache-config/${ATTIC_CACHE}")
134
148
substituter_endpoint=$(jq -r .substituter_endpoint <<< "$info")
135
149
public_key=$(jq -r .public_key <<< "$info")
@@ -151,28 +165,30 @@ jobs:
151
165
ATTIC_SERVER : ${{ vars.ATTIC_SERVER }}
152
166
ATTIC_CACHE : ${{ vars.ATTIC_CACHE }}
153
167
ATTIC_TOKEN : ${{ secrets.ATTIC_TOKEN }}
168
+
154
169
- name : start upterm session
155
170
if : ${{ inputs.upterm }}
156
171
uses : owenthereal/action-upterm@v1
157
172
with :
158
173
limit-access-to-actor : true
174
+
159
175
- name : generate report
160
176
id : report
161
177
run : |
162
- base64=$(nix build --no-link --print-out-paths github:nixos/nixpkgs/nixos-unstable#coreutils)/bin/base64
163
178
if [[ -s fetch_cmd ]]; then
164
179
cat fetch_cmd
165
- echo fetch_cmd_${{ matrix.system }}=$($ base64 -w0 fetch_cmd) >> "$GITHUB_OUTPUT"
180
+ echo fetch_cmd_${{ matrix.system }}=$(base64 -w0 fetch_cmd) >> "$GITHUB_OUTPUT"
166
181
fi
167
182
report=~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/report.md
168
183
cat $report
169
- echo report_${{ matrix.system }}=$($ base64 -w0 $report) >> "$GITHUB_OUTPUT"
184
+ echo report_${{ matrix.system }}=$(base64 -w0 $report) >> "$GITHUB_OUTPUT"
170
185
171
186
report :
172
187
runs-on : ubuntu-latest
173
188
needs : [review]
174
189
outputs :
175
190
report : ${{ steps.report.outputs.report }}
191
+
176
192
steps :
177
193
- name : generate report
178
194
id : report
@@ -214,9 +230,11 @@ jobs:
214
230
needs : [report]
215
231
if : ${{ inputs.post-result }}
216
232
environment : post-result
233
+
217
234
steps :
218
235
- name : fetch report
219
236
run : echo ${{ needs.report.outputs.report }} | base64 -d > report.md
237
+
220
238
- name : post comment
221
239
run : |
222
240
if [[ -n "$GH_TOKEN" ]]; then
0 commit comments