2.x #417
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: ArkProject rs CI | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "crates/**" | |
pull_request: | |
paths: | |
- "crates/**" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
setup: | |
name: Setup rust ci | |
runs-on: ubuntu-latest | |
outputs: | |
date: ${{ steps.date.outputs.date }} | |
steps: | |
- name: Get current date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
check: | |
needs: setup | |
name: Check rust crates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Cache cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
test: | |
needs: check | |
name: Test rust crates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --workspace | |
lints: | |
if: github.event_name == 'pull_request' | |
name: Lints rust crates | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Cache cargo dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -p ark-starknet -p ark-metadata -p pontos -- -D warnings |