-
Notifications
You must be signed in to change notification settings - Fork 660
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: move a chunk of the Rust CI over to GHA (#9290)
GHA has many significant benefits compared to buildkite, most major of it is that blindly using GHA is not going to by default allow untrusted contributors to run arbitrary code – instead GitHub will present reviewers a button they can click after reviewing the PR. It also makes maintenance of the CI infrastructure somewhat easier, which given our soon-to-be-stretched-very-thin infrastructure team is a huge benefit. In process of implementing this PR I ended up simplifying a lot of the Rust testing as well. In particular instead of running half a dozen of different combinations on just Linux, we now run just the nightly vs non-nightly versions. This saves CPU time on many different rebuilds… Of note, one feature that no longer gets tested is `mock_node`, as it was causing a failure in one of the integration tests. If we wanted to re-enable this particular test, we should figure out how to fix the test, rather than adding a new test configuration. As a final benefit, I’ve also added a m1 macOS-based job. This should help with making sure that people who develop on company-issued laptops can actually be productive, rather than have to tip-toe around a boatload of failing tests. We will have an ability to decide whether we want to block PRs landing on this job in the repository configuration at any point in the future.
- Loading branch information
Showing
13 changed files
with
86 additions
and
102 deletions.
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
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,42 @@ | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
cargo_nextest: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: ubuntu-22.04-8core | ||
flags: "" | ||
- os: ubuntu-22.04-8core | ||
flags: "--features nightly,test_features" | ||
- os: macOS-m1 | ||
# FIXME: some of these tests don't work very well on MacOS at the moment. Should fix | ||
# them at earliest convenience :) | ||
flags: "--exclude integration-tests --exclude node-runtime --exclude runtime-params-estimator --exclude near-network --exclude estimator-warehouse" | ||
timeout-minutes: 90 | ||
|
||
steps: | ||
# Some of the tests allocate really sparse maps, so heuristic-based overcommit limits are not | ||
# appropriate here. | ||
# FIXME(#9634): remove this once the issue is resolved. | ||
- run: sudo sysctl vm.overcommit_memory=1 || true | ||
- uses: actions/checkout@v2 | ||
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941 | ||
with: | ||
crate: cargo-nextest | ||
- uses: baptiste0928/cargo-install@21a18ba3bf4a184d1804e8b759930d3471b1c941 | ||
with: | ||
crate: cargo-deny | ||
- run: cargo nextest run --locked --workspace -p '*' --cargo-profile quick-release --profile ci ${{ matrix.flags }} | ||
env: | ||
RUST_BACKTRACE: short |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env bash | ||
cd "${0%/*}/../.." # ensure we're in the workspace directory | ||
rm target/rpc_errors_schema.json | ||
rm -f target/rpc_errors_schema.json | ||
cargo build -p near-jsonrpc --features dump_errors_schema | ||
cp target/rpc_errors_schema.json chain/jsonrpc/res/rpc_errors_schema.json |
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
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
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
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 |
---|---|---|
@@ -1,14 +1,2 @@ | ||
#!/usr/bin/env bash | ||
# clippy adoption is in progress, see https://github.com/near/nearcore/issues/8145 | ||
|
||
LINTS=( | ||
-A clippy::all | ||
-D clippy::clone_on_copy | ||
-D clippy::correctness | ||
-D clippy::derivable_impls | ||
-D clippy::redundant_clone | ||
-D clippy::suspicious | ||
-D clippy::len_zero | ||
) | ||
|
||
cargo clippy --all-targets -- "${LINTS[@]}" | ||
exec cargo nextest run -p style-tests clippy |
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