Skip to content

Commit

Permalink
ci(offchain): run code quality assessment
Browse files Browse the repository at this point in the history
While here, move code format and dependency checking to the code quality
workflow.
  • Loading branch information
marcelstanley authored and gligneul committed Jul 31, 2023
1 parent c2cb48b commit c951db8
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 30 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ jobs:
run: cargo install cargo-cache
continue-on-error: true

- name: Check format
run: cargo fmt --all -- --check

- name: Set sweep timestamp
run: cargo sweep -s

Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Offchain code quality assessment
on:
push:
paths:
- '.github/workflows/code-quality.yml'
- 'offchain/**'
jobs:
assess-offchain-code-quality:
runs-on: ubuntu-latest
env:
CARGO_REGISTRIES_CARTESI_INDEX: https://github.com/cartesi/crates-index
defaults:
run:
working-directory: offchain

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
token: ${{ secrets.CI_TOKEN }}

- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
offchain/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- name: Install protoc
run: sudo apt update && sudo apt install -y protobuf-compiler libprotobuf-dev

- name: Update rust
run: rustup update

- name: Install cargo-machete
run: cargo install cargo-machete

- name: Analyze dependencies
run: cargo machete .
continue-on-error: true

- name: Check format
run: cargo fmt --all -- --check

- name: Run linter
run: cargo clippy
27 changes: 0 additions & 27 deletions .github/workflows/dependencies.yml

This file was deleted.

0 comments on commit c951db8

Please sign in to comment.