name: Rust CI
on:
pull_request:
branches:
- '**'
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
CI:
runs-on: ubuntu-latest
name: cargo CI
permissions:
contents: write
steps:
- name: install system dependencies
run: |
sudo apt update
sudo apt install libunwind-dev
- name: get repo
uses: actions/checkout@v4
- name: install rust
uses: dtolnay/rust-toolchain@stable
- name: install additional rust things
run: |
rustup component add rustfmt
rustup component add clippy
- name: cargo clippy check
run: cargo clippy --all-features --all-targets --workspace
- name: cargo clippy fix
run: cargo clippy --fix --all-features --all-targets --workspace
- name: cargo fmt
run: cargo fmt --all
- name: cargo test
run: cargo test --all-features && cargo test --no-default-features
- name: commit back to repository
if: "!contains(github.ref, 'master')"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "ci: automatic Rust CI changes"