Speed up CI and modernize tests #193
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
name: Rust testing and building | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
setup-rust: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: 1.79.0 | |
components: clippy, rustfmt | |
target: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
- name: Install nextest | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: nextest | |
lint: | |
needs: setup-rust | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
component: [near] | |
check: [clippy, fmt] | |
steps: | |
- name: Run ${{ matrix.check }} | |
run: | | |
make ${{ matrix.check }}-${{ matrix.component }} | |
build: | |
needs: setup-rust | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build Near contract | |
run: | | |
make rust-build-near | |
test: | |
needs: setup-rust | |
runs-on: ubuntu-latest | |
steps: | |
- name: Test Near contracts | |
run: | | |
make test-near |