-
-
Notifications
You must be signed in to change notification settings - Fork 111
63 lines (47 loc) · 1.43 KB
/
check-flake-files.yml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: "Check Flake Groups"
on:
workflow_dispatch:
pull_request:
paths:
- "flakes/**.toml"
jobs:
automatic-custom-flakes-check:
runs-on: ubuntu-latest
strategy:
fail-fast: true
env:
RUST_LOG: debug
steps:
- name: Checking out the repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
uses: ./.github/actions/common-setup
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
- name: Try importing all custom flakes
run: |
shopt -s globstar
had_error=0
for folder in flakes/*/; do
flake_group=$(basename "$folder")
echo "::group::Group \""$flake_group"\""
flake_toml=flakes/"$flake_group".toml
cat $(git diff --name-only HEAD~1 -- "$folder"/*.toml) > "$flake_toml"
nix run --accept-flake-config .#flake-info -- --json group "$flake_toml" "$flake_group" --report
if [[ -f "./report.txt" ]]
then
had_error=1
# sic.:
# Workaround for multi line output
report="$(< ./report.txt)"
report="${report//'%'/'%25'}"
report="${report//$'\n'/'%0A'}"
report="${report//$'\r'/'%0D'}"
echo "::error file=$flake_toml::$report"
fi
echo ::endgroup::
done
exit $had_error