Adjust library layout and improve docs #52
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: | | |
# Full tests for Linux only, due to requirement of running local API hosted through docker | |
if [ "$RUNNER_OS" == "Linux" ]; then | |
docker compose up -d --wait | |
# Wait for Frankfurter container to fetch data | |
sleep 60 | |
cargo test --all --verbose | |
docker compose down | |
else | |
cargo test --package lib_frankfurter --lib | |
cargo test --package frankfurter_cli --bin frs | |
fi | |
shell: bash |