forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
549d2f5
commit fcaa0e9
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# This workflow allows a contributor to run nixpkgs-review in their own fork, using | ||
# their own allocated Github Actions runners. | ||
# To get started, make sure that the master branch of your fork contains this workflow. | ||
# Then: | ||
# - Go to Actions -> A run of nixpkgs-review | ||
# - Click "Run workflow" | ||
# - Enter the upstream pull request number | ||
# - Click "Run workflow" | ||
|
||
# Note, this begins with "A" on purpose, to make it appear at the top of the list | ||
# of workflows for convenience. | ||
name: "A run of nixpkgs-review" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: Nixpkgs PR Number | ||
required: true | ||
|
||
run-name: "nixpkgs-review for #${{ inputs.pr }}" | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
nixpkgs-review: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- runner: macos-14 | ||
system: aarch64-darwin | ||
- runner: macos-13 | ||
system: x86_64-darwin | ||
# TODO: Add aarch64-linux once https://github.com/github/roadmap/issues/970 is available. | ||
- runner: ubuntu-24.04 | ||
system: x86_64-linux | ||
|
||
name: "#${{ inputs.pr }} @ ${{ matrix.system }}" | ||
runs-on: ${{ matrix.runner }} | ||
env: | ||
PR_NUMBER: ${{ inputs.pr }} | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
|
||
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30 | ||
|
||
- name: Collect debug info | ||
run: | | ||
echo Running nixpkgs-review version: | ||
# Using nixpkgs channel instead of local checkout to avoid having to keep | ||
# a the fork's master branch up to date. | ||
nix run 'nixpkgs#nixpkgs-review' -- --version | ||
- name: Run nixpkgs-review | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
mkdir report-${{ matrix.system }} | ||
nix run 'nixpkgs#nixpkgs-review' -- \ | ||
pr --print-result \ | ||
--run 'mv logs report.json report.md "${{ github.workspace }}"/report-${{ matrix.system }}' \ | ||
--systems current \ | ||
"$PR_NUMBER" | ||
- name: Upload report | ||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 | ||
with: | ||
name: report-${{ matrix.system }} | ||
path: report-${{ matrix.system }} | ||
|
||
summary: | ||
name: "#${{ inputs.pr }} summary" | ||
needs: nixpkgs-review | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Download reports | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | ||
|
||
- name: Post step summary | ||
run: | | ||
for folder in report-*; do | ||
csplit --prefix="$folder-" -n1 "$folder/report.md" "/---/" | ||
done | ||
cat report-x86_64-linux-0 >> "$GITHUB_STEP_SUMMARY" | ||
cat report-*-1 >> "$GITHUB_STEP_SUMMARY" |