linter #6
Workflow file for this run
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: linter | |
permissions: | |
contents: read | |
on: | |
push: | |
paths: | |
- ".github/workflows/linter.yml" | |
- "**.rs" | |
- "**.toml" | |
- "**/Cargo.lock" | |
- "**/Makefile" | |
branches: [ "main" ] | |
pull_request: | |
paths: | |
- ".github/workflows/linter.yml" | |
- "**.rs" | |
- "**.toml" | |
- "**/Cargo.lock" | |
- "**/Makefile" | |
branches: [ "main" ] | |
workflow_dispatch: | |
inputs: | |
commit_sha: | |
description: Git commit sha, on which, to run this workflow | |
# concurrency: | |
# group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} | |
# cancel-in-progress: true | |
jobs: | |
lint_commits: | |
name: Lint Commit Messages | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Check Commit Lint | |
uses: wagoid/commitlint-github-action@v5.4.5 | |
lint_check: | |
name: Rust - lint_all | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
lint_projects: | |
- cargo_fmt_check | |
- cargo_clippy | |
# - cargo_deny | |
- cargo_toml_files | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
components: rustfmt, clippy | |
- name: Rust Cache | |
uses: actions/cache@v3 | |
continue-on-error: false | |
with: | |
path: | | |
~/.cargo/bin | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-sdk-rust-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-sdk-rust- | |
- name: Check cargo version | |
run: cargo --version | |
- name: Format | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy --verbose -- -D warnings | |
- name: Check Cargo.toml files | |
run: cargo check --workspace --all-targets --all-features | |
# - name: Check Cargo deny | |
# run: cargo deny check licenses | |