name: Rust
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: No default features
flags: --no-default-features
- name: Native-crypto feature
flags: --no-default-features --features native-crypto
steps:
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/checkout@v4
- name: Install libpam, libssl-dev
run: sudo apt -y install libpam0g-dev libssl-dev
- name: Format check
run: cargo fmt --check
- name: Build
run: cargo build --verbose
- name: Run tests with $${{ matrix.name }}
run: cargo test --verbose ${{ matrix.flags }}
- name: Clippy check
run: cargo clippy --no-deps