Skip to content

Commit

Permalink
ci: par jobs, naming, concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
hrls committed Oct 8, 2024
1 parent 4bc7cf2 commit f2ff646
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check
name: Code Hygiene

on:
workflow_dispatch:
Expand All @@ -9,13 +9,19 @@ on:
- stagenet
- mainnet

env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


jobs:
build:
rust:
name: 'cargo check'
runs-on: ubuntu-latest

env:
CARGO_TERM_COLOR: always

steps:
- uses: actions/checkout@v4

Expand All @@ -24,23 +30,19 @@ jobs:
target: wasm32-unknown-unknown
components: rustfmt clippy rust-src

- name: Install system deps
run: sudo apt-get install protobuf-compiler jq ripgrep shellcheck fd-find
- run: sudo apt-get install protobuf-compiler jq ripgrep

- name: Build
run: cargo build --locked
- run: cargo build --locked

- name: Run tests
run: cargo test --locked
- run: cargo test --locked

- name: Check format
run: |
rustup toolchain add nightly-x86_64-unknown-linux-gnu
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
cargo +nightly fmt -- --check
- name: Clippy checks
run: cargo clippy --all-targets -- --deny warnings
- run: cargo clippy --all-targets -- --deny warnings

- name: Clippy checks all features (exclude node and runtime)
run: |
Expand All @@ -50,5 +52,15 @@ jobs:
| rg --invert-match 'atleta-(node|runtime)' \
| xargs -I {} cargo clippy --package {} --all-targets --all-features -- --deny warnings --deny missing_docs
etc:
name: 'shell scripts'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- run: sudo apt-get install shellcheck fd-find

- name: Run shellcheck
run: fdfind --type executable --exec bash -c 'echo {}; shellcheck {}'

0 comments on commit f2ff646

Please sign in to comment.