Add tests #19
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: Check | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
check: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install nightly Rust toolchain | |
run: | | |
rustup toolchain install nightly --profile minimal | |
rustup component add clippy rustfmt --toolchain nightly | |
rustup default nightly | |
- name: Cache dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Check | |
run: cargo check --all | |
- name: Format | |
run: cargo fmt --all --check | |
- name: Build | |
run: cargo build --all --verbose | |
- name: Docs | |
run: cargo doc --all --verbose | |
- name: Lint | |
run: cargo clippy --all -- -D warnings | |
- name: Tests | |
run: | | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
brew install docker docker-compose | |
docker-compose up -d --wait | |
else | |
docker compose up -d --wait | |
fi | |
cargo test --all --verbose | |
if [ "$RUNNER_OS" == "macOS" ]; then | |
docker-compose down | |
else | |
docker compose down | |
fi |