Skip to content

Commit

Permalink
Add a CI check for the CI source files
Browse files Browse the repository at this point in the history
Check on the CI that the (generated) CI config files do match their
Nickel source.

Not as nice as a really dynamic CI, but at least makes sure that things
don't drift apart
  • Loading branch information
Théophane Hufschmitt committed Jun 5, 2024
1 parent 663041d commit cb48cc3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/check-up-to-date-generated-files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
jobs:
check-up-to-date-generated-files:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Nix
uses: cachix/install-nix-action@v26
with:
extra_nix_config: accept-flake-config = true
- uses: cachix/cachix-action@v14
with:
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
name: nickel-schemastore
- name: Check that the file generated by Organist are up-to-date
run: |-
nix run .#regenerate-files -L
git diff --exit-code && echo "All files up-to-date ✅"
on:
push: {}
18 changes: 18 additions & 0 deletions gh-actions.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,22 @@ in
on.schedule = [{ cron = "0 0 * * 0" }],
on.workflow_dispatch = {},
},

check-up-to-date-generated-files = {
on.push = {},
jobs.check-up-to-date-generated-files = {
runs-on = "ubuntu-latest",
steps =
setup
@ [
{
name = "Check that the file generated by Organist are up-to-date",
run = m%"
nix run .#regenerate-files -L
git diff --exit-code && echo "All files up-to-date ✅"
"%
}
],
},
},
} | { _ | gha }

0 comments on commit cb48cc3

Please sign in to comment.