-
Notifications
You must be signed in to change notification settings - Fork 94
Force linting scripts to align rust toolchain with latest nix shell and not latest nightly #1536
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
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 |
|---|---|---|
|
|
@@ -45,30 +45,30 @@ jobs: | |
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Install nightly toolchain" | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: clippy | ||
| - name: "Use cache" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "Install nix" | ||
| uses: DeterminateSystems/determinate-nix-action@main | ||
| - name: "Use nix cache" | ||
| uses: DeterminateSystems/magic-nix-cache-action@main | ||
| - name: "Run linting check" | ||
| run: cd payjoin-ffi && bash contrib/lint.sh | ||
| run: cd payjoin-ffi && nix develop -c ./contrib/lint.sh | ||
|
|
||
| Lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: "Checkout repo" | ||
| uses: actions/checkout@v4 | ||
| - name: "Install nightly toolchain" | ||
| uses: dtolnay/rust-toolchain@nightly | ||
| with: | ||
| components: clippy | ||
| - name: "Use cache" | ||
| uses: Swatinem/rust-cache@v2 | ||
| - name: "Install nix" | ||
| uses: DeterminateSystems/determinate-nix-action@main | ||
| - name: "Use nix cache" | ||
| uses: DeterminateSystems/magic-nix-cache-action@main | ||
| - name: "Run code linting" | ||
| run: bash contrib/lint.sh | ||
| run: nix develop -c ./contrib/lint.sh | ||
| - name: "Run documentation linting" | ||
| run: RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items | ||
| run: nix develop -c -- bash -c 'RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features --document-private-items' | ||
|
Comment on lines
-69
to
+71
Contributor
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 Every time
maxic-nix-cache only eliminates downloads. Robot suggests the following environment setup step as best practice. but I'm not sure yet what best practice here actually is, but my hunch is that they're doing it right at fedimint. Environment setup and tool running are separate steps that should stay separate to be clean IMO. Non-blocking, but needs to be fixed after.
Contributor
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. Correction: The shim that does this right seems to be Still non-blocking. Leaving as concrete pointer for the follow-up (please make an issue when u merge/close)
Contributor
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. fedimint does a bunch of complicated stuff which is great for them but loses the multi-toolchain running. They have unique derivations for Ci jobs rather than defining them primarily in YML. And have their own runners that stay warm with their caches. Different thing we don't need yet.
Contributor
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. microsoft donating 1s more of cpu time seems like a fair price to pay for not introducing a github action dependency that isn't really necessary, or rolling our own and debugging string escaping rules in bash in javascript in yaml
if we reach the point where it's more than just a sprinkling here or there and that action is legitimately useful i'd argue things are too tightly coupled to the nightmare that is github actions
Collaborator
Author
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. Interesting what fedimint does here just running their whole pre-commit hook https://github.com/fedimint/fedimint/blob/c1f97273aa59c1580f03a38530ad104072cdb412/.github/workflows/ci-nix.yml#L62 |
||
|
|
||
| Coverage: | ||
| name: Code coverage | ||
|
|
||
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 suspect this depends on having rust tooling installed, please confirm:
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.
The caching does seem to still work. Here is a run after the workflow changed so no cache.
https://github.com/payjoin/rust-payjoin/actions/runs/25561782784/job/75034980403?pr=1536#step:3:1 followed by a subsequent run with a cache even after the rust toolchain install had been removed https://github.com/payjoin/rust-payjoin/actions/runs/25562206670/job/75036441940?pr=1536#step:3:1
Even with using the dev shell the rust cache seems to be a substantial time saver.
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.
caching definitely makes sense if it's impactful, quick feedback is always helpful.
if
dtolnay/rust-toolchainis still needed forSwatinem/rust-cachethen please just add a big scary comment that makes it clear that the lints are running using nix provided rust toolchain and that the additional rustup provided one is there only for the cache action to workThere 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.
ugh, github's new UI is such a buggy piece of shit, but in addition to being buggy it's also confusing, i clicked into the diff and thought i was looking at a recent one and concluded that only one copy of the rust-toolchain action was removed for some reason