-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (48 loc) · 1.64 KB
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
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