Skip to content

Commit

Permalink
Fix Nix CI (#175)
Browse files Browse the repository at this point in the history
* Trigger examples in Nix CI

* Ignore beta schema in CI

* Update taskfile

* Standardize to run command via task
  • Loading branch information
kachick authored Apr 25, 2024
1 parent ce033f6 commit 2b4c91b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/ci-nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ on:
- 'flake.*'
- 'go.mod'
- 'Taskfile.yml'
- 'examples/**'
pull_request:
paths:
- '.github/workflows/ci-nix.yml'
- '*.nix'
- 'flake.*'
- 'go.mod'
- 'Taskfile.yml'
- 'examples/**'
schedule:
# Every 10:42 JST
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule
Expand All @@ -34,8 +36,3 @@ jobs:
- run: nix develop --command task deps
- run: nix develop --command task
- run: nix run . -- --version
- run: |
nix develop --command bash -c '
git ls-files examples .github | \
xargs nix run . -- list --skip-by=this_command_does_not_exist_so_raise_errors_and_do_not_update_this_file
'
7 changes: 4 additions & 3 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ tasks:
- task: lint
- task: test
- task: build
- task: list
install:
cmds:
- go install -ldflags "-X main.commit=$(git rev-parse HEAD)"
Expand All @@ -19,14 +20,14 @@ tasks:
- go build -o ./dist/selfup ./cmd/selfup
run:
cmds:
- go run ./cmd/selfup run --prefix='# selfup ' --skip-by='nix run' .github/workflows/*.yml
- git ls-files -- examples ':!:*beta*' | xargs go run ./cmd/selfup run --skip-by=do_not_update_this_file
list:
cmds:
- go run ./cmd/selfup list --prefix='# selfup ' --skip-by='nix run' .github/workflows/*.yml
- git ls-files -- examples ':!:*beta*' | xargs go run ./cmd/selfup list --skip-by=do_not_update_this_file
update:
cmds:
- nix flake update --commit-lock-file
- nix develop --command go run ./cmd/selfup run --prefix='# selfup ' --skip-by='nix run' .github/workflows/*.yml
- nix develop --command go run ./cmd/selfup run .github/workflows/*.yml
- git diff-index --quiet HEAD || git commit -m 'Update CI dependencies with adjusting to nixpkgs' .github
test:
cmds:
Expand Down

0 comments on commit 2b4c91b

Please sign in to comment.