2022-02-27 23:02:11 +00:00
|
|
|
name: "Check Flake Groups"
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2022-03-01 12:50:18 +00:00
|
|
|
- "flakes/**.toml"
|
2022-02-27 23:02:11 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
automatic-custom-flakes-check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUST_LOG: debug
|
2022-02-27 23:10:09 +00:00
|
|
|
|
2022-02-27 23:02:11 +00:00
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checking out the repository
|
2022-03-02 11:05:42 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-02-27 23:02:11 +00:00
|
|
|
|
2022-02-27 23:10:09 +00:00
|
|
|
- name: Setup
|
|
|
|
uses: ./.github/actions/common-setup
|
2022-02-27 23:02:11 +00:00
|
|
|
with:
|
2022-10-29 20:58:44 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2022-02-27 23:10:09 +00:00
|
|
|
CACHIX_SIGNING_KEY: ${{ secrets.CACHIX_SIGNING_KEY }}
|
2022-02-27 23:02:11 +00:00
|
|
|
|
|
|
|
- name: Try importing all custom flakes
|
|
|
|
run: |
|
2022-02-28 15:19:31 +00:00
|
|
|
shopt -s globstar
|
2022-03-01 12:50:18 +00:00
|
|
|
|
|
|
|
had_error=0
|
|
|
|
|
2022-02-27 23:02:11 +00:00
|
|
|
for flake_group in flakes/**/*.toml
|
|
|
|
do
|
2022-03-01 12:50:18 +00:00
|
|
|
echo "::group::Group \"$(basename $flake_group .toml)\""
|
2022-03-30 18:45:35 +00:00
|
|
|
|
|
|
|
nix run .#flake-info -- group "$flake_group" "$(basename "$flake_group" .toml)" --report
|
2022-03-01 12:50:18 +00:00
|
|
|
|
|
|
|
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'}"
|
2022-03-30 18:45:35 +00:00
|
|
|
|
2022-03-01 12:50:18 +00:00
|
|
|
echo "::error file=$flake_group::$report"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo ::endgroup::
|
|
|
|
|
2022-02-27 23:02:11 +00:00
|
|
|
done
|
2022-03-01 12:50:18 +00:00
|
|
|
exit $had_error
|