-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (62 loc) · 1.81 KB
/
validate-commit.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
62
63
64
65
66
67
68
name: validate commit
on:
pull_request:
push:
branches:
- master
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target/debug
key: test-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
- run: cargo test
# There is a bug with BSD tar on macOS where the first 8MB of the file are
# sometimes all NUL bytes. See https://github.com/actions/cache/issues/403
# and https://github.com/rust-lang/cargo/issues/8603 for some more
# information. An alternative solution here is to install GNU tar, but
# flushing the disk cache seems to work, too.
- run: sudo purge
if: startsWith(matrix.os, 'macos-')
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target/debug
key: lint-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
- run: cargo clippy -- -D warnings
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: cargo fmt --all -- --check
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target/release
key: benchmark-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}-${{ secrets.CI_CACHE_VERSION }}
- run: cargo bench