-
Notifications
You must be signed in to change notification settings - Fork 82
41 lines (40 loc) · 1.66 KB
/
check_variants.yaml
File metadata and controls
41 lines (40 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: "Check build variants"
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened] # trigger on PRs
paths-ignore:
- "docs/**"
- "*.md"
workflow_dispatch:
jobs:
build:
name: Check build variants
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: cachix/install-nix-action@616559265b40713947b9c190a8ff4b507b5df49b # v31.10.4
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Generate variants JSON
run: nix eval --raw .#lib.allBuildVariantsJSON | nix run nixpkgs#jq 'walk(if type == "array" then sort else . end)' > nix-builder/build-variants.json
- name: Check if variants JSON is up-to-date
run: |
if git diff --exit-code nix-builder/build-variants.json; then
echo "✅ variants.json is up-to-date"
else
echo "🛑 regenerate variants.json: nix eval --raw .#lib.allBuildVariantsJSON | nix run nixpkgs#jq 'walk(if type == "array" then sort else . end)' > nix-builder/build-variants.json"
exit 1
fi
- name: Generate variants Markdown
run: nix run nixpkgs#python3 nix-builder/scripts/gen_variants_markdown.py
- name: Check if variants Markdown is up-to-date
run: |
if git diff --exit-code docs/source/builder/build-variants.md; then
echo "✅ docs/source/buidler/build-variants.md is up-to-date"
else
echo "🛑 regenerate docs/build-variants: nix run nixpkgs#python3 nix-builder/scripts/gen_variants_markdown.py"
exit 1
fi