-
-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: introduce nixf-tidy-action
#1469
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: nixf-tidy code linter | ||
|
||
on: | ||
[ pull_request ] | ||
|
||
jobs: | ||
nixf-tidy: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
|
||
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: cachix/install-nix-action@v22 | ||
inclyc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
with: | ||
github_access_token: ${{ secrets.GITHUB_TOKEN }} | ||
extra_nix_config: | | ||
trusted-public-keys = nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= | ||
substituters = https://nix-community.cachix.org https://cache.nixos.org/ | ||
- run: nix profile install github:nix-community/nixd#nixd | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO this should be the responsibility of the Is there some technical reason why we need to install the action's dependency in our workflow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Thanks, I just wrote (Otherwise these installation should be performed in "js" exec, looks bad!) |
||
- uses: inclyc/nixf-tidy-action@v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer YAML syntax to JSON-style
Also, I'm not sure pull_request is the right event here. That runs whenever a PR is opened, edited, reviewed, etc (see "activity types").
Instead, we'd want this to run whenever a branch is updated (push).
We could use
branches-ignore
to prevent running onmain
andnixos-*
, but IMO I don't see an issue with having the CI on these branches too.Note if the action expects
github.event.pull_request.head.sha
, this'll be missing when usingon.push
. Insteadgithub.sha
orGITHUB_SHA
should be used for non-pr events.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't test it exactly for events other than "pull_request", maybe I should update the action itself then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some of my assumptions were off here. The
pull_request
event does get triggered by a bunch of stuff, but pushes to a PR branch don't always seem to trigger thepush
event...