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: |
|
2022-11-16 15:36:45 +00:00
|
|
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
2023-01-16 16:53:11 +00:00
|
|
|
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nixcache:8KKuGz95Pk4UJ5W/Ni+pN+v+LDTkMMFV4yrGmAYgkDg= hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs= cache:6tx18bfuH66LOfrn37EmN2YxwNZI3qNk3lKHoz/XlXI=
|
2022-11-16 15:36:45 +00:00
|
|
|
experimental-features = nix-command flakes ca-derivations
|
|
|
|
post-build-hook = ${{ github.workspace }}/scripts/post-build-hook
|
2023-01-16 16:53:11 +00:00
|
|
|
substituters = https://cache.chir.rs/ https://cache.nixos.org/ https://attic.chir.rs/cache
|
2022-11-18 11:54:14 +00:00
|
|
|
- name: Download patched nix
|
|
|
|
run: nix build github:DarkKirb/nix-packages#nix-s3-dedup
|
2023-01-16 16:53:11 +00:00
|
|
|
- name: Download attic
|
|
|
|
run: nix build github:DarkKirb/nix-packages#attic-client
|
2022-11-16 16:06:53 +00:00
|
|
|
- name: Set up secrets
|
|
|
|
run: |
|
|
|
|
echo "$NIX_CACHE_KEY" > ~/cache.key
|
|
|
|
sudo mkdir /root/.aws
|
|
|
|
echo "$AWS_CREDENTIALS" | sudo tee /root/.aws/credentials > /dev/null
|
2023-01-16 16:53:11 +00:00
|
|
|
nix run github:DarkKirb/nix-packages#attic-client -- login attic-server https://attic.chir.rs/ "$ATTIC_TOKEN"
|
2022-11-16 16:06:53 +00:00
|
|
|
env:
|
|
|
|
NIX_CACHE_KEY: ${{secrets.NIX_CACHE_KEY}}
|
|
|
|
AWS_CREDENTIALS: ${{secrets.AWS_CREDENTIALS}}
|
2023-01-16 16:53:11 +00:00
|
|
|
ATTIC_TOKEN: ${{secrets.ATTIC_TOKEN}}
|
2022-05-18 20:24:55 +00:00
|
|
|
- run: |
|
2022-05-27 06:53:05 +00:00
|
|
|
|
2022-12-20 08:18:36 +00:00
|
|
|
for job in nixos-8gb-fsn1-1.x86_64-linux nutty-noon.x86_64-linux thinkrac.x86_64-linux nas.x86_64-linux instance-20221213-1915.aarch64-linux; do
|
2022-12-13 20:20:34 +00:00
|
|
|
nix show-derivation -r "github:DarkKirb/nixos-config/main#hydraJobs.$job" > old-$job.json
|
2022-05-27 06:53:05 +00:00
|
|
|
done
|
|
|
|
|
2022-05-18 20:24:55 +00:00
|
|
|
echo "Difference between this PR and main:" > review
|
|
|
|
echo "" >> review
|
|
|
|
|
2022-12-20 08:18:36 +00:00
|
|
|
for job in nixos-8gb-fsn1-1.x86_64-linux nutty-noon.x86_64-linux thinkrac.x86_64-linux nas.x86_64-linux instance-20221213-1915.aarch64-linux; do
|
2022-12-13 20:20:34 +00:00
|
|
|
nix show-derivation -r ".#hydraJobs.$job" > new-$job.json
|
2022-05-27 06:53:05 +00:00
|
|
|
|
|
|
|
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
|
2022-11-16 16:06:53 +00:00
|
|
|
mv review .github/workflows
|
2022-05-18 20:24:55 +00:00
|
|
|
- uses: harupy/comment-on-pr@master
|
|
|
|
env:
|
2022-11-16 16:06:53 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-05-18 20:24:55 +00:00
|
|
|
with:
|
|
|
|
filename: review
|