Bat/pre genesis wallet #5936
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: Run checks | |
on: | |
push: | |
branches: | |
- main | |
# Run in PRs with conflicts (https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request) | |
pull_request_target: | |
types: [opened, synchronize, reopened] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | |
cancel-in-progress: true | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
GIT_LFS_SKIP_SMUDGE: 1 | |
jobs: | |
clippy-fmt: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
nightly_version: [nightly-2023-06-01] | |
make: | |
- name: Clippy | |
command: clippy | |
cache_subkey: clippy | |
cache_version: v1 | |
- name: Format | |
command: check && make fmt-check | |
cache_subkey: fmt | |
cache_version: v1 | |
env: | |
CARGO_INCREMENTAL: 0 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
if: ${{ github.event_name != 'pull_request_target' }} | |
- name: Checkout PR | |
uses: actions/checkout@v3 | |
if: ${{ github.event_name == 'pull_request_target' }} | |
# See comment in build-and-test.yml | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup rust toolchain | |
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36 | |
with: | |
target: wasm32-unknown-unknown | |
profile: default | |
override: true | |
- name: Setup rust nightly | |
uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36 | |
with: | |
toolchain: ${{ matrix.nightly_version }} | |
target: wasm32-unknown-unknown | |
profile: default | |
- name: Show rust toolchain info | |
run: rustup show | |
- name: Cache cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git | |
~/.cargo/.crates.toml | |
~/.cargo/.crates2.json | |
./target | |
./wasm/tx_template/target | |
./wasm/vp_template/target | |
./wasm_for_tests/wasm_source/target | |
key: ${{ runner.os }}-${{ matrix.make.cache_subkey }}-${{ matrix.make.cache_version }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-${{ matrix.make.cache_subkey }}-${{ matrix.make.cache_version }}-cargo- | |
- name: ${{ matrix.make.name }} | |
run: make ${{ matrix.make.command }} | |
- name: Clean cache folder | |
run: | | |
cargo install cargo-cache --no-default-features --features ci-autoclean cargo-cache || true | |
cargo-cache |