-
Notifications
You must be signed in to change notification settings - Fork 1
112 lines (92 loc) · 3.11 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: CI
on: [push, pull_request]
defaults:
run:
shell: bash
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
toolchain: [stable, beta, nightly]
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- i686-unknown-linux-gnu
- i686-unknown-linux-musl
features:
- ''
- serde
- std serde
include:
- toolchain: nightly
target: x86_64-unknown-linux-gnu
features: sc
# Allow nightly builds to fail
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
runs-on: ubuntu-latest
steps:
- name: Set up repo
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
targets: ${{ matrix.target }}
- name: Install 32-bit glibc build dependencies
run: sudo apt-get update && sudo apt-get -y install gcc-multilib
if: matrix.target == 'i686-unknown-linux-gnu'
- name: Build
run: cargo +${{ matrix.toolchain }} build --verbose --target ${{ matrix.target }} --no-default-features --features "${{ matrix.features }}"
- name: Run tests
run: cargo +${{ matrix.toolchain }} test --verbose --target ${{ matrix.target }} --no-default-features --features "${{ matrix.features }}"
- name: Run tests (in user namespace)
run: unshare -r cargo +${{ matrix.toolchain }} test --verbose --target ${{ matrix.target }} --no-default-features --features "${{ matrix.features }}"
coverage-tarpaulin:
name: Tarpaulin
strategy:
fail-fast: false
matrix:
toolchain: [stable]
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
features:
- ''
prefix:
- ''
- unshare -r
include:
- toolchain: nightly
target: x86_64-unknown-linux-gnu
features: sc
prefix: ''
- toolchain: nightly
target: x86_64-unknown-linux-gnu
features: sc
prefix: unshare -r
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
- name: Install tarpaulin
run: cargo install cargo-tarpaulin
- name: Run tarpaulin
run: ${{ matrix.prefix }} cargo +${{ matrix.toolchain }} tarpaulin --verbose --out Xml --target ${{ matrix.target }} --features "${{ matrix.features }}"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: ${{ matrix.toolchain }}-${{ matrix.target }}
fail_ci_if_error: true
env_vars: OS,TARGET,TOOLCHAIN,JOB
env:
JOB: ${{ github.job }}
OS: ${{ matrix.os }}
TARGET: ${{ matrix.target }}
TOOLCHAIN: ${{ matrix.toolchain }}
FEATURES: ${{ matrix.features }}