forked from rust-lang/log
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (50 loc) · 1.38 KB
/
unit-tests.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
61
name: Unit tests
on:
pull_request:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- macos
- ubuntu
- windows
runs-on: ${{ matrix.os }}-latest
name: unit tests on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Configure toolchain
run: |
rustup toolchain install nightly --component rustfmt,clippy --no-self-update --profile minimal
rustup default nightly
- name: Configure caching
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-unit-tests-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-unit-tests
- name: Install deps
if: matrix.os == 'ubuntu'
run: sudo .github/scripts/install-deps.sh
- name: Test (Unix)
if: matrix.os != 'windows'
run: cargo test --no-default-features --features pkg-config,native-tls
- name: Test (Windows)
if: matrix.os == 'windows'
run: cargo test --no-default-features --features native-tls
- name: fmt
run: cargo fmt --all --check
- name: clippy
run: cargo clippy --no-deps -- -D clippy::all