forked from huggingface/kernel-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (37 loc) Β· 1.43 KB
/
check_variants.yaml
File metadata and controls
38 lines (37 loc) Β· 1.43 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
name: "Check build variants"
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened] # trigger on PRs
workflow_dispatch:
jobs:
build:
name: Check build variants
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v27
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)' > build-variants.json
- name: Check if variants JSON is up-to-date
run: |
if git diff --exit-code 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)' > build-variants.json"
exit 1
fi
- name: Generate variants Markdown
run: nix run nixpkgs#python3 scripts/gen_variants_markdown.py
- name: Check if variants Markdown is up-to-date
run: |
if git diff --exit-code docs/build-variants.md; then
echo "β
docs/build-variants.md is up-to-date"
else
echo "π regenerate docs/build-variants: nix run nixpkgs#python3 scripts/gen_variants_markdown.py"
exit 1
fi