Skip to content

Commit cdcd824

Browse files
committed
init
0 parents  commit cdcd824

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/review.yml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: review
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
pr:
7+
description: "Pull Request Number"
8+
required: true
9+
type: number
10+
nixpkgs-review:
11+
description: "nixpkgs-review flake"
12+
required: true
13+
type: string
14+
default: github:Mic92/nixpkgs-review
15+
x86_64-linux:
16+
description: "Run on x86_64-linux"
17+
required: true
18+
type: boolean
19+
default: true
20+
aarch64-linux:
21+
description: "Run on aarch64-linux"
22+
required: true
23+
type: boolean
24+
default: true
25+
x86_64-darwin:
26+
description: "Run on x86_64-darwin"
27+
required: true
28+
type: boolean
29+
default: true
30+
aarch64-darwin:
31+
description: "Run on aarch64-darwin"
32+
required: true
33+
type: boolean
34+
default: true
35+
36+
jobs:
37+
review:
38+
strategy:
39+
matrix:
40+
system:
41+
- x86_64-linux
42+
- aarch64-linux
43+
- x86_64-darwin
44+
- aarch64-darwin
45+
exclude:
46+
- system: ${{ !inputs.x86_64-linux && 'x86_64-linux' || '' }}
47+
- system: ${{ !inputs.aarch64-linux && 'aarch64-linux' || '' }}
48+
- system: ${{ !inputs.x86_64-darwin && 'x86_64-darwin' || '' }}
49+
- system: ${{ !inputs.aarch64-darwin && 'aarch64-darwin' || '' }}
50+
fail-fast: false
51+
runs-on: >-
52+
${{ (matrix.system == 'x86_64-linux' && 'ubuntu-latest')
53+
|| (matrix.system == 'aarch64-linux' && 'ubuntu-24.04-arm')
54+
|| (matrix.system == 'x86_64-darwin' && 'macos-13')
55+
|| (matrix.system == 'aarch64-darwin' && 'macos-latest') }}
56+
outputs:
57+
report_x86_64-linux: ${{ steps.report.outputs.report_x86_64-linux }}
58+
report_aarch64-linux: ${{ steps.report.outputs.report_aarch64-linux }}
59+
report_x86_64-darwin: ${{ steps.report.outputs.report_x86_64-darwin }}
60+
report_aarch64-darwin: ${{ steps.report.outputs.report_aarch64-darwin }}
61+
steps:
62+
- uses: DeterminateSystems/nix-installer-action@v16
63+
- uses: actions/checkout@v4
64+
with:
65+
repository: NixOS/nixpkgs
66+
- run: nix run ${{ inputs.nixpkgs-review }} -- pr ${{ inputs.pr }} --no-shell
67+
env:
68+
GITHUB_TOKEN: ${{ github.token }}
69+
- run: echo report_${{ matrix.system }}=$(sed -e '1i\\n---' -e '1,/^---/d' ~/.cache/nixpkgs-review/pr-${{ inputs.pr }}/report.md | base64 -w0) >> "$GITHUB_OUTPUT"
70+
id: report
71+
72+
post-result:
73+
runs-on: ubuntu-latest
74+
needs: [review]
75+
steps:
76+
- run: |
77+
cat << EOF > report.md
78+
## \`nixpkgs-review\` result
79+
80+
Generated using [\`nixpkgs-review\`](https://github.com/Mic92/nixpkgs-review).
81+
82+
Command: \`nixpkgs-review pr ${{ inputs.pr }}\`
83+
84+
Logs: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
85+
EOF
86+
87+
echo ${{ needs.review.outputs.report_x86_64-linux }} | base64 -d >> report.md
88+
echo ${{ needs.review.outputs.report_aarch64-linux }} | base64 -d >> report.md
89+
echo ${{ needs.review.outputs.report_x86_64-darwin }} | base64 -d >> report.md
90+
echo ${{ needs.review.outputs.report_aarch64-darwin }} | base64 -d >> report.md
91+
92+
cat report.md

0 commit comments

Comments
 (0)