-
Notifications
You must be signed in to change notification settings - Fork 3
82 lines (65 loc) · 2.01 KB
/
rust.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Rust
on:
push:
branches:
- "**"
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: get rust version
id: rustc_version
run: echo ::set-output name=version::$(rustc --version)
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ steps.rustc_version.version }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-
${{ runner.os }}-cargo-
- name: check formatting
run: cargo fmt --all -- --check
- name: compiler check
run: cargo check --tests --examples
- name: tests
run: cargo test --verbose
- name: linter
run: cargo clippy -- -D warnings
- name: run the pedantic linter (warnings only)
run: cargo clippy --color=always --all-targets -- -W clippy::pedantic
build:
needs: check
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: get rust version
id: rustc_version
run: echo ::set-output name=version::$(rustc --version)
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-${{ steps.rustc_version.version }}
restore-keys: |
${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}-
${{ runner.os }}-cargo-
- run: cargo build --release
- run: mv target/release/schema2000{,_${{ runner.os }}}
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: schema2000
path: target/release/schema2000_${{ runner.os }}