Skip to content

Commit

Permalink
actions: post all results at once
Browse files Browse the repository at this point in the history
Signed-off-by: lucasew <[email protected]>
  • Loading branch information
lucasew committed Dec 23, 2024
1 parent 60d27ba commit fc687f1
Showing 1 changed file with 45 additions and 4 deletions.
49 changes: 45 additions & 4 deletions .github/workflows/nixpkgs-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ concurrency:
cancel-in-progress: true

jobs:
comment:
pre-run:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
Expand Down Expand Up @@ -75,6 +75,32 @@ jobs:
repo: 'nixpkgs',
body: process.env.MESSAGE
})
post-run:
runs-on: ubuntu-latest
needs:
- build-x86_64-linux
- build-aarch64-darwin
- build-x86_64-darwin
if: ${{ always() }}
steps:
- name: Fetch reports from runners
uses: actions/download-artifact@v4
with:
path: reports
pattern: report-*
- name: Join reports
run: cat reports/**/*.md > report.md
- uses: actions/github-script@v7
with:
script: |
const fs = require('node:fs');
github.rest.issues.createComment({
issue_number: process.env.PR,
owner: 'NixOS',
repo: 'nixpkgs',
body: fs.readFileSync("report.md")
})
build-x86_64-linux:
name: 'x86_64-linux'
if: ${{ github.event.inputs.x86_64-linux == 'true' }}
Expand Down Expand Up @@ -115,7 +141,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "user"
cd $GITHUB_WORKSPACE/nixpkgs
nix run nixpkgs#nixpkgs-review -- pr $PR --print-result --post-result --no-shell $EXTRA_ARGS
nix run nixpkgs#nixpkgs-review -- pr $PR --print-result --no-shell $EXTRA_ARGS
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -124,6 +150,11 @@ jobs:
~/.cache/nixpkgs-review/*/logs
/nix/var/log/nix/drvs
include-hidden-files: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: report-x86_64-linux
path: ~/.cache/nixpkgs-review/*/report.md

build-aarch64-darwin:
name: 'aarch64-darwin'
Expand Down Expand Up @@ -155,7 +186,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "user"
cd $GITHUB_WORKSPACE/nixpkgs
nix run nixpkgs#nixpkgs-review -- pr $PR --print-result --post-result --no-shell $EXTRA_ARGS
nix run nixpkgs#nixpkgs-review -- pr $PR --print-result --no-shell $EXTRA_ARGS
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -164,6 +195,11 @@ jobs:
/nix/var/log/nix/drvs
~/.cache/nixpkgs-review/*/logs
include-hidden-files: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: report-aarch64-darwin
path: ~/.cache/nixpkgs-review/*/report.md

build-x86_64-darwin:
name: 'x86_64-darwin'
Expand Down Expand Up @@ -195,7 +231,7 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "user"
cd $GITHUB_WORKSPACE/nixpkgs
nix run nixpkgs#nixpkgs-review -- pr $PR --print-result --post-result --no-shell $EXTRA_ARGS
nix run nixpkgs#nixpkgs-review -- pr $PR --print-result --no-shell $EXTRA_ARGS
- uses: actions/upload-artifact@v4
if: always()
with:
Expand All @@ -204,3 +240,8 @@ jobs:
/nix/var/log/nix/drvs
~/.cache/nixpkgs-review/*/logs
include-hidden-files: true
- uses: actions/upload-artifact@v4
if: always()
with:
name: report-x86_64-darwin
path: ~/.cache/nixpkgs-review/*/report.md

0 comments on commit fc687f1

Please sign in to comment.