-
Notifications
You must be signed in to change notification settings - Fork 40
clean up and speed up test suite with nextest
#582
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
Conversation
3b71f2b to
fbfaf27
Compare
nextest
f90329a to
62be787
Compare
Co-authored-by: José Molina <[email protected]>
.github/workflows/ci.yml
Outdated
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 4 months ago
To resolve this true positive, you should add an explicit permissions block at the top/root of your workflow file (.github/workflows/ci.yml). This block should specify the minimal required permissions for the tasks performed in this workflow. Since none of the jobs in the portion shown require write access to repository contents (they mostly run tests, upload coverage, etc.), it is safe and recommended to use contents: read as the baseline. If any job (such as codecov uploads or release creation) requires further permissions, you can add those types with the least privilege needed (such as pull-requests: write if one creates pull requests). In this case, a root-level block will apply to all jobs unless overridden by a job-specific permissions key.
Specifically:
- Insert a
permissions:block between the workflowname:and theon:key. - The block should read:
permissions: contents: read
- This change limits the default token to read-only for repository contents, supporting the principle of least privilege.
-
Copy modified lines R2-R3
| @@ -1,4 +1,6 @@ | ||
| name: ci | ||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| push: |
al3mart
left a comment
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.
Awesome improvements! 🔥
Some of our current unit tests perform expensive operations (e.g., downloading dependencies, building projects) and connect to live networks like Pop Network. This pushed CI unit test runs to over an hour and caused instability when RPC endpoints were unavailable.
Changes
pop_chain,pop_contractsandpop_common.cargo testin CI withcargo nextest. (~60% faster, also used in cargo-contract).ink-node).Results
cargo nextest run --lib --bins↓ to ~400s.Closes #535