-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (69 loc) · 2 KB
/
test.yaml
File metadata and controls
73 lines (69 loc) · 2 KB
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
62
63
64
65
66
67
68
69
70
71
72
73
name: test
on:
pull_request:
branches:
- master
jobs:
test:
name: Rust ${{ matrix.os }} ${{ matrix.rust }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
rust:
- stable
- beta
- nightly
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: Install GNU tar
if: matrix.os == 'macos-latest'
run: |
brew install gnu-tar
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
- name: Cache cargo registy
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-registy-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo test
uses: actions/cache@v2
with:
path: target
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-test-target-${{ hashFiles('**/Cargo.toml') }}
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: ${{ matrix.rust }}
override: true
- uses: actions-rs/cargo@v1
name: show rustfmt version
with:
command: fmt
args: --version
- uses: actions-rs/cargo@v1
name: run rustfmt check
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
name: show clippy version
with:
command: clippy
args: --version
- uses: actions-rs/cargo@v1
name: run clippy check
with:
command: clippy
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --release --all-features
continue-on-error: ${{ matrix.rust == 'nightly' }}