-
-
Notifications
You must be signed in to change notification settings - Fork 347
ci: added treefmt workflow to gha and removed from buildbot #3611
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
base: main
Are you sure you want to change the base?
Changes from all commits
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,31 @@ | ||||||||||||||||||||
name: Formatting | ||||||||||||||||||||
|
||||||||||||||||||||
on: | ||||||||||||||||||||
pull_request: | ||||||||||||||||||||
paths-ignore: | ||||||||||||||||||||
- "**.md" | ||||||||||||||||||||
- "**.svg" | ||||||||||||||||||||
- ".gitignore" | ||||||||||||||||||||
- "LICENSE" | ||||||||||||||||||||
- "flake.lock" | ||||||||||||||||||||
push: | ||||||||||||||||||||
branches: | ||||||||||||||||||||
- main | ||||||||||||||||||||
paths-ignore: | ||||||||||||||||||||
- "**.md" | ||||||||||||||||||||
- "**.svg" | ||||||||||||||||||||
- ".gitignore" | ||||||||||||||||||||
- "LICENSE" | ||||||||||||||||||||
- "flake.lock" | ||||||||||||||||||||
Comment on lines
+11
to
+19
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. We don't really need to do this on Additionally, we'll need to add this or a meta-job to our “required status checks”; cc @GaetanLepage I'll try and look into adding a meta-job we can use for this, similar to the 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. I'll handle merge queues and required checks in #3611 For now it is fine to just remove the
Suggested change
|
||||||||||||||||||||
|
||||||||||||||||||||
jobs: | ||||||||||||||||||||
treefmt: | ||||||||||||||||||||
name: Check formatting with treefmt | ||||||||||||||||||||
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. This name shows up in the status check list as Bike-shedding the names doesn't block this PR, because we can change them at any time in other PRs. But my personal preference would be to be less verbose and avoid redundancy between workflow & job names. How about |
||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||
steps: | ||||||||||||||||||||
- name: Checkout repository | ||||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||||
- name: Install Nix | ||||||||||||||||||||
uses: cachix/install-nix-action@v31 | ||||||||||||||||||||
- name: Run treefmt check | ||||||||||||||||||||
run: nix build .#checks.x86_64-linux.treefmt | ||||||||||||||||||||
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. Running with Alternatively, we could use a cachix GHA step, like we do in some other workflows. That way we can also push builds to cachix. |
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.
GHA recently added support for yaml anchors and references, so we can avoid needing to write this list twice.
The first instance should declare the anchor with
&ignored
, then the second instance can be replaced with a reference to it with*ignored
Not relevant if we're removing the
on: push
event, though.It'd also be nice to see a comment on this list, cross-referencing it with the treefmt-nix configuration so we remember to keep both in sync.
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.
whoot? TIL. That's great to hear. Although from looking into it, it seems to be pretty limited :/.
Uh oh!
There was an error while loading. Please reload this page.
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.
Support is tracked in actions/runner#1182
I assume most limitations come from workflows not supporting arbitrary unknown keys?
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.
Arbitrary keys + merge keys were what I used a lot for GitLab. Also GitLab can reference "templates" across files (different syntax, but same concepts). This would be so much better than re-usable workflows or custom actions for code reuse...