-
Notifications
You must be signed in to change notification settings - Fork 4
212 lines (197 loc) · 7.39 KB
/
ci.yml
File metadata and controls
212 lines (197 loc) · 7.39 KB
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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
env:
CARGO_TERM_COLOR: always
CARGO_HOME: ${{ github.workspace }}/.cargo
RUSTFLAGS: -D warnings -A unused-imports
RUSTDOCFLAGS: -D warnings
RUST_BACKTRACE: full
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup update stable --no-self-update
- run: rustc -Vv
- run: cargo fmt --all -- --check
unit-tests:
name: ${{ matrix.basename }} - ${{ matrix.os }} - ${{ matrix.llvm[0] }} - ${{ matrix.features }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental || matrix.llvm[0] != '17.0' }}
strategy:
matrix:
llvm:
- ["15.0", "15-0", "150"]
- ["16.0", "16-0", "160"]
- ["17.0", "17-0", "170"]
- ["18.1", "18-1", "181"]
- ["19.1", "19-1", "191", "19"]
- ["20.1", "20-1", "201", "20"]
- ["21.1", "21-1", "211", "21"]
toolchain:
- stable
os:
- ubuntu-latest
- macos-latest
features:
- "rayon cranelift external_f64 external_f32"
experimental:
- false
tests:
- true
clippy:
- false
rustdoc:
- false
basename:
- Tests
include:
- toolchain: stable
os: windows-latest
llvm: ""
features: "rayon cranelift external_f64"
tests: true
clippy: false
rustdoc: false
experimental: false
basename: Tests
- toolchain: beta
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift external_f64"
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Beta
- toolchain: nightly
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift external_f64"
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Nightly
- toolchain: stable
os: ubuntu-latest
llvm: ""
features: ""
tests: true
clippy: false
rustdoc: false
experimental: true
basename: Tests
- toolchain: stable
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift external_f64"
tests: false
clippy: true
rustdoc: false
experimental: true
basename: Clippy
- toolchain: nightly
os: ubuntu-latest
llvm: ["16.0", "16-0", "160"]
features: "rayon cranelift external_f64"
tests: false
clippy: false
rustdoc: true
experimental: true
basename: Rustdoc
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/cache@v3
with:
path: |
${{ env.CARGO_HOME }}
target
key: unit-test-${{ runner.os }}-${{ matrix.toolchain}}-${{ matrix.llvm[0] }}-${{ matrix.features }}
- name: Set up Rust
run: rustup default ${{ matrix.toolchain }} && rustup update ${{ matrix.toolchain }} --no-self-update && rustup component add clippy rust-docs
- name: Rust version
run: rustc -Vv
- name: Install LLVM and Clang (LLVM >= 19.1 & macos)
if : matrix.llvm != '' && matrix.os == 'macos-latest' && (matrix.llvm[0] >= '19.1')
run: |
brew install llvm@${{ matrix.llvm[3] }}
echo "LLVM_PATH=$(brew --prefix llvm@${{ matrix.llvm[3] }})" >> $GITHUB_ENV
- name: Install LLVM and Clang (LLVM >= 19.1 & ubuntu)
if : matrix.llvm != '' && (matrix.os == 'ubuntu-latest'|| matrix.os == 'ubuntu-24.04-arm') && (matrix.llvm[0] >= '19.1')
run: |
sudo apt install --no-install-recommends -y lsb-release wget software-properties-common gnupg
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${{ matrix.llvm[3] }}
sudo apt-get update
sudo apt install --no-install-recommends -y libllvm${{ matrix.llvm[3] }} \
llvm-${{ matrix.llvm[3] }} \
llvm-${{ matrix.llvm[3] }}-dev \
llvm-${{ matrix.llvm[3] }}-runtime \
libpolly-${{ matrix.llvm[3] }}-dev
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${{ matrix.llvm[3] }} 10
echo "LLVM_PATH=/usr/lib/llvm-${{ matrix.llvm[3] }}" >> $GITHUB_ENV
- name: Install LLVM and Clang (LLVM < 19.1)
uses: KyleMayes/install-llvm-action@v2
if : matrix.llvm != '' && (matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' || matrix.os == 'ubuntu-24.04-arm') && (matrix.llvm[0] < '19.1')
with:
version: ${{ matrix.llvm[0] }}
- name: Set LLVM_SYS_XXX_DIR and CC, CXX environment variables
if : matrix.llvm != ''
run: |
echo "LLVM_SYS_${{ matrix.llvm[2] }}_DIR=${LLVM_PATH}" >> $GITHUB_ENV
- name: Install LLVM 16 (macos-13)
if : matrix.os == 'macos-13'
run:
brew install llvm@16
- name: Install dependencies (for ubuntu-latest and LLVM 18.1)
if : matrix.llvm[0] == '18.1' && matrix.os == 'ubuntu-latest'
run: |
sudo apt update
wget http://security.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.3-2ubuntu0.1_amd64.deb
sudo apt install ./libtinfo5_6.3-2ubuntu0.1_amd64.deb
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Run tests (LLVM)
if : matrix.tests && matrix.llvm != ''
run: cargo test --verbose --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"
- name: Run tests
if : matrix.tests && matrix.llvm == ''
run: cargo test --verbose --features "${{ matrix.features }}"
- name: Run Clippy (LLVM)
if: matrix.clippy
run: cargo clippy --verbose --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"
- name: Run Docs (LLVM)
if: matrix.rustdoc
run: cargo rustdoc -p diffsl --features llvm${{ matrix.llvm[1] }} --features "${{ matrix.features }}"
book:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup mdBook
uses: peaceiris/actions-mdbook@v1
with:
mdbook-version: 'latest'
- run: mdbook build book
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./book/book