Merge pull request #4 from ChainSafe/ec2/fix-build #10
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 | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
jobs: | |
build-mips: | |
uses: ./.github/workflows/mips.yml | |
secrets: inherit | |
test: | |
runs-on: ubuntu-latest | |
needs: build-mips | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install development tools | |
uses: taiki-e/[email protected] | |
with: | |
tool: cargo-nextest,just | |
- name: Install `rust` toolchain | |
run: | | |
rustup toolchain install nightly --no-self-update --profile minimal | |
rustup default nightly | |
- name: Setup protoc | |
uses: arduino/[email protected] | |
- name: Download consensus-spec-tests | |
run: just download-integration-tests | |
- name: Build the zipline tests (slow) | |
run: just cache-zipline-tests | |
- uses: actions/download-artifact@v3 # download the cached binary | |
with: | |
name: spec_test_out.bin | |
path: zipline-state-transition-mips/build/ | |
- uses: actions/download-artifact@v3 # download the cached binary | |
with: | |
name: mainnet_out.bin | |
path: zipline-state-transition-mips/build/ | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --release -p crypto -p preimage-oracle -p zipline-finality-client -p zipline-spec -p cannon-emulator | |
build-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup protoc | |
uses: arduino/[email protected] | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --all | |
lints: | |
name: clippy and fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
override: true | |
components: clippy,rustfmt | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
continue-on-error: false | |
with: | |
command: fmt | |
args: --all -- --check | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings |