forked from heim-rs/heim
-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (143 loc) · 4.92 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
on: [push, pull_request]
name: Continuous integration
jobs:
# Lints are going first, since it is cheap to run them
# and we want to fail as fast as possible
rustfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- run: cargo fmt --all -- --check
clippy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- run: cargo clippy --all-targets --workspace -- -D warnings
# Now, let's check that code compiles at least
compile:
name: ${{ matrix.toolchain }} / ${{ matrix.triple.target }}
needs: [rustfmt, clippy]
runs-on: ${{ matrix.triple.os }}
strategy:
fail-fast: false
matrix:
triple:
# Tier 1 platforms
- { os: 'ubuntu-latest', target: 'x86_64-unknown-linux-gnu', cross: false }
- { os: 'ubuntu-latest', target: 'i686-unknown-linux-gnu', cross: true }
- { os: 'macOS-latest', target: 'x86_64-apple-darwin', cross: false }
# TODO: cross does not support it
# - { os: 'windows-latest', target: 'i686-pc-windows-msvc', cross: true }
- { os: 'windows-latest', target: 'x86_64-pc-windows-msvc', cross: false }
# Tier 2 platforms
## ARM64
- { os: 'ubuntu-latest', target: 'aarch64-unknown-linux-gnu', cross: true }
- { os: 'ubuntu-latest', target: 'aarch64-unknown-linux-musl', cross: true }
## ARMv7
- { os: 'ubuntu-latest', target: 'armv7-unknown-linux-gnueabihf', cross: true }
- { os: 'ubuntu-latest', target: 'armv7-unknown-linux-musleabihf', cross: true }
## ARMv6
- { os: 'ubuntu-latest', target: 'arm-unknown-linux-gnueabihf', cross: true }
- { os: 'ubuntu-latest', target: 'arm-unknown-linux-musleabihf', cross: true }
toolchain:
- 1.46.0 # MSRV
- stable
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --features full --target=${{ matrix.triple.target }} --manifest-path=heim/Cargo.toml
use-cross: ${{ matrix.triple.cross }}
# Test suite is executed for Tier 1 platforms now,
# which mean we can do that natively on the Actions VMs
tests:
needs: [compile]
name: Test ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Having some test issues with Windows and `proc_macro_hack` crate,
# allowing to fail for a while
continue-on-error: true
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
# We need nightly for `-Zprofile`
toolchain:
- nightly
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
override: true
- name: Execute tests (not macOS)
if: startsWith(matrix.os, 'macOS') == false
run: cargo test --no-fail-fast
env:
RUST_BACKTRACE: full
CARGO_INCREMENTAL: 0
RUSTDOCFLAGS: "-Cpanic=abort"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off"
- name: Execute tests (macOS)
if: startsWith(matrix.os, 'macOS') == true
run: cargo test --no-fail-fast
env:
RUST_BACKTRACE: full
CARGO_INCREMENTAL: 0
RUSTDOCFLAGS: "-Cpanic=abort"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Coverflow-checks=off"
- name: Install grcov
uses: actions-rs/[email protected]
with:
crate: grcov
- name: Gather coverage data
id: coverage
uses: actions-rs/[email protected]
with:
coveralls-token: ${{ secrets.COVERALLS_TOKEN }}
- name: Coveralls upload
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel: true
path-to-lcov: ${{ steps.coverage.outputs.report }}
code_coverage_finalize:
runs-on: ubuntu-latest
needs: tests
steps:
- name: Coveralls finalization
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true