Github actions #2
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: Pull Request Checks | |
on: | |
pull_request: | |
branches: [ "main", "master" ] | |
paths-ignore: | |
- '**.md' | |
- 'docs/**' | |
- '.gitignore' | |
env: | |
CARGO_TERM_COLOR: always | |
RUSTFLAGS: "-D warnings" | |
jobs: | |
check: | |
name: Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.78.0 | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-directories: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git | |
target | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- name: Run cargo check | |
run: cargo check --all-targets | |
test: | |
name: Test Suite | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.78.0 | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-directories: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git | |
target | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- name: Run cargo test | |
run: cargo test | |
lints: | |
name: Lints | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: 1.78.0 | |
components: clippy, rustfmt | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-directories: | | |
~/.cargo/registry/index | |
~/.cargo/registry/cache | |
~/.cargo/git | |
target | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y pkg-config libssl-dev | |
- name: Run cargo fmt | |
run: cargo fmt --all -- --check | |
- name: Run cargo clippy | |
run: cargo clippy --all-targets |