-
Notifications
You must be signed in to change notification settings - Fork 760
78 lines (70 loc) · 2.27 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Unit Tests
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: "Tests"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
config:
# Linux
- { os: ubuntu-latest, toolchain: stable, target: x86_64-unknown-linux-gnu, cross: false }
# Macos
- { os: macos-latest, toolchain: stable, target: x86_64-apple-darwin, cross: false }
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Rust setup
run: |
bash ./scripts/setup/dev_setup.sh
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-testcache-${{ secrets.CACHE_RESET_KEY }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-testcache-${{ secrets.CACHE_RESET_KEY }}-
${{ runner.os }}-cargo-testcache-
${{ runner.os }}-cargo-
- name: Run test
uses: actions-rs/cargo@v1
with:
command: test
components: rustfmt
args: --all-features --no-fail-fast
env:
RUST_LOG: debug
RUST_BACKTRACE: full
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
- name: Install grcov
uses: actions-rs/install@v0.1
with:
crate: grcov
version: latest
use-tool-cache: true
- name: Run code coverage
uses: actions-rs/grcov@v0.1.5
id: coverage
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
- name: Upload artifact
uses: actions/upload-artifact@v2
if: failure()
with:
path: |
_local_fs/
_logs/
_meta/
query/_logs/
store/_logs/