-
-
Notifications
You must be signed in to change notification settings - Fork 6
215 lines (195 loc) · 6.62 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
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
206
207
208
209
210
211
212
213
214
215
# GitHub Actions workflow: CI for sic
# Originally based on `bstr` crate ci, which can be found at:
# https://github.com/BurntSushi/bstr/blob/master/.github/workflows/ci.yml
# `bstr` is licensed under Apache License, Version 2.0 or MIT license
# Installation of NASM with msvc toolchain has been copied from `rav1e`, used under the BSD 2-Clause license,
# reproduced below. The original source can be found at:
# https://github.com/xiph/rav1e/blob/eab1cd61c1c6a7d65d49726df62a99bd0a97b8fd/.github/workflows/rav1e.yml
#
#
# BSD 2-Clause License
#
# Copyright (c) 2017-2020, the rav1e contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
name: "sic_ci"
on:
pull_request:
push:
branches:
- master
- main
- staging # for Bors
- trying # for Bors
schedule:
- cron: '00 04 * * *'
env:
CI: 1
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
build: [ ubuntu-stable, macos-stable, win-gnu-stable, win-msvc-stable ]
include:
# latest rust stable :: ubuntu
- build: ubuntu-stable
os: ubuntu-latest
rust: stable
# latest rust stable :: mac_os
- build: macos-stable
os: macOS-latest
rust: stable
# latest rust stable :: windows + gnu
- build: win-gnu-stable
os: windows-latest
rust: stable-x86_64-gnu
# latest rust stable :: windows + msvc
- build: win-msvc-stable
os: windows-latest
rust: stable
steps:
- name: checkout_repo
uses: actions/checkout@v2
- name: install_nasm
if: matrix.build != 'win-msvc'
uses: ilammy/setup-nasm@v1
# from rav1e
- name: install_nasm_msvc
if: matrix.build == 'win-msvc-stable'
run: |
$NASM_VERSION="2.15.05"
$LINK = "https://www.nasm.us/pub/nasm/releasebuilds/$NASM_VERSION/win64"
$NASM_FILE = "nasm-$NASM_VERSION-win64"
curl --ssl-no-revoke -LO "$LINK/$NASM_FILE.zip"
7z e -y "$NASM_FILE.zip" -o"C:\nasm"
echo "C:\nasm" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# from rav1e
- name: set_path_msvc_linker
if: matrix.build == 'win-msvc-stable'
run: |
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
echo "$LinkPath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
profile: minimal
- name: build_workspace
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --all
- name: test_workspace
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all
- name: test_workspace_no_default_features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all --no-default-features
- name: test_workspace_all_features
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all --all-features
rustfmt:
name: rustfmt
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: checkout_repo
uses: actions/checkout@v2
- name: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: rustfmt
- name: check_rustfmt
run: |
cargo fmt --all -- --check
clippy:
name: clippy
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: checkout_repo
uses: actions/checkout@v2
- name: install_nasm
uses: ilammy/setup-nasm@v1
- name: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: clippy
- name: check_clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all-targets --workspace
cargo_deny:
name: cargo_deny
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
log-level: error
msrv:
name: msrv
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: checkout_repo
uses: actions/checkout@v2
- name: install_nasm
uses: ilammy/setup-nasm@v1
- name: install_rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: install_cargo_msrv
run: cargo install cargo-msrv
- name: version_of_cargo_msrv
run: cargo msrv --version # as of writing: 0.14.0 (required for verify subcommand)
- name: run_cargo_msrv
run: cargo msrv --ignore-lockfile --output-format json verify