nixos-config/.github/workflows/pr.yml

39 lines
1.4 KiB
YAML
Raw Normal View History

2022-05-18 20:24:55 +00:00
name: Pull request diff
on:
pull_request:
branches:
- main
jobs:
diff-expr:
name: Diff nix expressions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v17
with:
extra_nix_config: |
substituters = https://cache.nixos.org/ https://f000.backblazeb2.com/file/cache-chir-rs/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=
- run: |
2022-05-27 06:53:05 +00:00
for job in nixos-8gb-fsn1-1 nutty-noon thinkrac installer nas; do
nix show-derivation -r "github:DarkKirb/nixos-config/main#hydraJobs.$job.x86_64-linux" > old-$job.json
done
2022-05-18 20:24:55 +00:00
echo "Difference between this PR and main:" > review
echo "" >> review
for job in nixos-8gb-fsn1-1 nutty-noon thinkrac installer nas; do
2022-05-27 06:53:05 +00:00
nix show-derivation -r ".#hydraJobs.$job.x86_64-linux" > new-$job.json
echo "## Changes for $job:" >> review
echo '```' >> review
python scripts/diff-drvs.py old-$job.json new-$job.json >> review
echo '```' >> review
2022-05-18 20:24:55 +00:00
done
- uses: harupy/comment-on-pr@master
env:
2022-05-27 07:44:54 +00:00
GITHUB_TOKEN: ${{ github.workspace }}/${{ secrets.GITHUB_TOKEN }}
2022-05-18 20:24:55 +00:00
with:
filename: review