-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (102 loc) · 3.34 KB
/
ci.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Continuous integration
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
tests:
runs-on: ubuntu-latest
continue-on-error: false
strategy:
matrix:
rust:
- 1.63.0
- stable
- beta
- nightly
include:
- rust: stable
target: thumbv7em-none-eabihf
- rust: beta
target: thumbv7em-none-eabihf
- rust: nightly
coverage: 'send'
components: llvm-tools
target: thumbv7em-none-eabihf
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install ${{ matrix.rust }} toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: ${{ matrix.components }}
target: ${{ matrix.target }}
override: true
- name: Install grcov
if: matrix.coverage == 'send'
uses: actions-rs/install@v0.1
with:
crate: grcov
version: latest
use-tool-cache: true
- name: Tests
env:
RUSTFLAGS: '-D warnings'
run: |
cargo build --verbose --no-default-features
cargo test --verbose --no-default-features
cargo build --verbose --no-default-features --features=lz,lh1,lhx
cargo test --verbose --no-default-features --features=lz,lh1,lhx
cargo build --verbose --no-default-features --features=std
cargo test --verbose --no-default-features --features=std
cargo build --verbose --no-default-features --features=std,lz
cargo test --verbose --no-default-features --features=std,lz
cargo build --verbose --no-default-features --features=std,lh1
cargo test --verbose --no-default-features --features=std,lh1
cargo build --verbose --all-features
cargo test --verbose --all-features
- name: Test embedded
if: matrix.target
env:
RUSTFLAGS: '-D warnings'
run: |
cargo build -p delharc-embedded-example --target ${{ matrix.target }}
- name: Coverage
if: matrix.coverage == 'send'
env:
LLVM_PROFILE_FILE: "delharc-%p-%m.profraw"
RUSTFLAGS: "-Cinstrument-coverage"
run: |
cargo build --verbose --all-features
cargo test --verbose --all-features
grcov . \
--binary-path ./target/debug/ \
--branch \
--output-types lcov \
--source-dir . \
--output-path ./lcov.info \
--ignore-not-existing \
--keep-only 'src/*' \
--commit-sha ${{ github.sha }} \
--service-job-id ${{ github.job }} \
--service-name "GitHub Actions" \
--service-number ${{ github.run_id }}
- name: Upload coverage as artifact
if: matrix.coverage == 'send'
uses: actions/upload-artifact@v2
with:
name: lcov.info
path: ./lcov.info
if-no-files-found: error
- name: Upload coverage to Coveralls
if: matrix.coverage == 'send'
uses: coverallsapp/github-action@v2
with:
file: lcov.info
format: lcov