-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Upgrade to nearcore 1.37.0 (#85)
* chore: Upgrade to nearcore 1.37.0 * refactor: Set ubuntu-22.04 in workflow actions for test and release * refactor: Improve test workflow * address clippy warning
- Loading branch information
Showing
7 changed files
with
1,395 additions
and
1,275 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,51 @@ | ||
name: ci | ||
name: Rust checks | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
push: | ||
branches: [main] | ||
# schedule: | ||
# - cron: '00 01 * * *' | ||
jobs: | ||
test: | ||
name: test | ||
env: | ||
# For some builds, we use cross to test on 32-bit and big-endian | ||
# systems. | ||
CARGO: cargo | ||
# When CARGO is set to CROSS, this is set to `--target matrix.target`. | ||
TARGET_FLAGS: "" | ||
# When CARGO is set to CROSS, TARGET_DIR includes matrix.target. | ||
TARGET_DIR: ./target | ||
# For some builds, we disable ledger support | ||
FEATURES_FLAGS: | ||
# Emit backtraces on panics. | ||
RUST_BACKTRACE: 1 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- build: linux-x86_64 | ||
os: ubuntu-20.04 | ||
rust: stable | ||
target: x86_64-unknown-linux-gnu | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
profile: minimal | ||
override: true | ||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
- name: Use Cross | ||
run: | | ||
cargo install cross | ||
echo "CARGO=cross" >> $GITHUB_ENV | ||
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV | ||
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV | ||
- name: Build cross environment | ||
shell: bash | ||
run: | | ||
if [ -d "./cross/${{ matrix.target }}" ]; then | ||
docker build --tag "cross:${{ matrix.target }}" "./cross/${{ matrix.target }}" | ||
fi | ||
jobs: | ||
check-format-and-lint: | ||
name: Check & Lint | ||
runs-on: ubuntu-22.04-8core | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Show command used for Cargo | ||
run: | | ||
echo "cargo command is: ${{ env.CARGO }}" | ||
echo "target flag is: ${{ env.TARGET_FLAGS }}" | ||
- name: Install Rust toolchain | ||
run: | | ||
rustup update stable | ||
rustup default stable | ||
rustup component add rustfmt clippy | ||
- name: Build near-lake and all crates | ||
run: ${{ env.CARGO }} build --verbose --all ${{ env.TARGET_FLAGS }} ${{ env.FEATURES_FLAGS }} | ||
- name: Check code formatting | ||
run: cargo fmt --all -- --check | ||
|
||
- name: Run tests | ||
run: ${{ env.CARGO }} test --verbose --all ${{ env.TARGET_FLAGS }} ${{ env.FEATURES_FLAGS }} | ||
- name: Lint with clippy | ||
run: cargo clippy -- -D warnings | ||
|
||
rustfmt: | ||
name: rustfmt | ||
runs-on: ubuntu-20.04 | ||
cargo-check: | ||
name: Cargo Check | ||
runs-on: ubuntu-22.04-8core | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Install Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
override: true | ||
profile: minimal | ||
components: rustfmt | ||
- name: Check formatting | ||
run: | | ||
cargo fmt --all -- --check | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Rust toolchain | ||
run: | | ||
rustup update stable | ||
rustup default stable | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | ||
|
||
- name: Cargo Check | ||
run: cargo check --all |
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.