-
Notifications
You must be signed in to change notification settings - Fork 81
205 lines (177 loc) · 5.71 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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
Formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
components: rustfmt
- name: Check format
run: cargo fmt -- --check
Linting:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install stable toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
components: clippy
- name: Lint with clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
Testing:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install nightly toolchain
uses: actions-rs/[email protected]
with:
toolchain: nightly
override: true
- name: Install system dependencies
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
- uses: Swatinem/[email protected]
- name: Run cargo-tarpaulin
uses: actions-rs/[email protected]
with:
# TODO: update to latest tarpaulin once artefact download is fixed: https://github.com/actions-rs/tarpaulin/pull/23
version: "0.22.0"
args: "--all-features --run-types Tests,Doctests --out Lcov -- --test-threads 1"
- name: Upload coverage
uses: coverallsapp/github-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
Testing-Features:
needs: Formatting
runs-on: ubuntu-latest
strategy:
matrix:
target:
- no-default-features
- all-features
include:
- target: no-default-features
args: --no-default-features
use_cross: false
- target: all-features
args: --all-features
toolchain_target: x86_64-unknown-linux-musl
use_cross: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install stable toolchain
uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
- name: Install system dependencies
run: |
sudo apt-get install --yes zlib1g-dev libbz2-dev musl musl-dev musl-tools clang libc6-dev
- uses: Swatinem/[email protected]
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{ matrix.args }}
use-cross: ${{ matrix.use_cross }}
Testing-MacOS:
needs: Formatting
runs-on: macos-latest
strategy:
matrix:
target:
- intel-monterey
- intel-ventura
- silicon-sonoma
include:
- target: intel-monterey
os: macOS-12.0
toolchain_target: x86_64-apple-darwin
toolchain: stable
aux_args: --target x86_64-apple-darwin
default: true
- target: intel-ventura
os: macOS-13.0
toolchain_target: x86_64-apple-darwin
toolchain: stable
aux_args: --target x86_64-apple-darwin
default: true
- target: silicon-sonoma
os: macOS-14.0
toolchain_target: aarch64-apple-darwin
toolchain: stable
aux_args: ""
default: false
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install stable toolchain
uses: actions-rs/[email protected]
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.toolchain_target }}
override: true
default: ${{ matrix.default }}
- name: Install htslib dependencies
run: brew install bzip2 zlib xz curl-openssl
- name: Test
uses: actions-rs/[email protected]
with:
use-cross: false # cross is not supported on GHA OSX runner, see: https://github.community/t/why-is-docker-not-installed-on-macos/17017
command: test
args: --release --all-features --verbose ${{ matrix.aux_args }}
# Testing-OSX-MUSL-BigSur:
# needs: Formatting
# runs-on: macOS-11.0
# steps:
# Test MUSL builds on OSX
#
# - uses: actions-rs/[email protected]
# with:
# toolchain: stable
# target: x86_64-unknown-linux-musl
# override: true
# - name: Install OSX musl-cross
# run: brew install FiloSottile/musl-cross/musl-cross
# # https://github.com/FiloSottile/homebrew-musl-cross/issues/16
# - name: Provide musl-gcc symlink for the right musl arch
# run: ln -sf /usr/local/opt/musl-cross/libexec/bin/x86_64-linux-musl-gcc /usr/local/bin/musl-gcc
# - name: Test musl build without default features
# uses: actions-rs/cargo@v1
# with:
# use-cross: false # cross is not supported on GHA OSX runner, see: https://github.community/t/why-is-docker-not-installed-on-macos/17017
# command: test
# args: --release --target x86_64-unknown-linux-musl --no-default-features
# - name: Test musl build with all features and debug symbols (non --release) on OSX
# uses: actions-rs/[email protected]
# with:
# use-cross: false
# command: test
# args: --target x86_64-unknown-linux-musl --all-features --verbose