forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat(CI): handle remote files in a safer way #2217
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "Download and verify remote files" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download (Unix) | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
run: curl -L -o ${{ inputs.output_file }} ${{ inputs.url }} | ||
|
||
- name: Download (Windows) | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: Invoke-WebRequest -Uri ${{ inputs.url }} -OutFile ${{ inputs.output_file }} | ||
|
||
- name: Verify (Unix) | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
run: | | ||
if [[ "$RUNNER_OS" == "macOS" ]]; then | ||
echo "${{ inputs.checksum }} *${{ inputs.output_file }}" | shasum -a 256 -c | ||
else | ||
echo "${{ inputs.checksum }} ${{ inputs.output_file }}" | sha256sum -c | ||
fi | ||
|
||
- name: Verify (Windows) | ||
if: runner.os == 'Windows' | ||
shell: powershell | ||
run: | | ||
$expectedChecksum = "${{ inputs.checksum }}" | ||
$actualChecksum = (Get-FileHash -Path "${{ inputs.output_file }}" -Algorithm SHA256).Hash | ||
if ($expectedChecksum -ne $actualChecksum) { | ||
Write-Output "Checksum did not match! Expected: $expectedChecksum, Found: $actualChecksum" | ||
exit 1 | ||
} | ||
|
||
inputs: | ||
url: | ||
description: "URL of the remote file." | ||
required: true | ||
output_file: | ||
description: "Output path." | ||
required: true | ||
checksum: | ||
description: "Expected checksum of the downloaded file." | ||
required: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
paramiko
pip packageIs there some reason we don't want to lock these as well?
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.
They are fairly known dependencies and if we lock the versions we might miss the important fixes. It's also helpful to see if we are compatible with their recent releases.
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.
Can we use scp instead of paramiko? I understand windows is an outlier here, and we might continue to use it in that case.
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.
It's not clear to me what requires libudev. It's reference in the fmt-and-lint workflow only. Is it required for cargo clippy or cargo fmt?
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.
We can but we need to rewrite this script.
It's probably outdated (since e71e2cf maybe?), let me try to remove it.
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.
We have this https://github.com/KomodoPlatform/komodo-defi-framework/actions/runs/10940703111/job/30373689262?pr=2217#step:7:1267 in CI after
libudev
removalThere 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.
Most probably required from the non-default features.
Reverted.
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.
requirement is introduced by
[email protected]
Could we check if this is absolutely necessary? Can someone please confirm that we actually use this crate?
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.
It is necessary for
enable-solana
feature (and we run--all-features
for linting runner). As we don't provide any output (like executable binary) to public from linting runner, there shouldn't be any concern for includinglibudev
in that runner I think.