From f2ff646fe0d2085247d63bb83b20c62733b60668 Mon Sep 17 00:00:00 2001 From: hrls Date: Tue, 8 Oct 2024 16:52:14 +0300 Subject: [PATCH] ci: par jobs, naming, concurrency --- .github/workflows/check.yml | 36 ++++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a23a56e..deb880d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,4 +1,4 @@ -name: Check +name: Code Hygiene on: workflow_dispatch: @@ -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 @@ -24,14 +30,11 @@ 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: | @@ -39,8 +42,7 @@ jobs: 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: | @@ -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 {}'