1212 runs-on : ${{ matrix.os }}
1313 strategy :
1414 matrix :
15- build : [stable, beta, nightly, linux32, macos, aarch64-macos, aarch64-ios, win32, win64, mingw32, mingw64, windows-2019]
15+ build :
16+ [
17+ stable,
18+ beta,
19+ nightly,
20+ linux32,
21+ macos,
22+ aarch64-macos,
23+ aarch64-ios,
24+ win32,
25+ win64,
26+ mingw32,
27+ mingw64,
28+ windows-2019,
29+ ]
1630 include :
1731 - build : stable
1832 os : ubuntu-latest
@@ -72,29 +86,53 @@ jobs:
7286 os : windows-2019
7387 rust : stable-x86_64
7488 target : x86_64-pc-windows-msvc
89+ - build : windows-clang
90+ os : windows-2019
91+ rust : stable
92+ target : x86_64-pc-windows-msvc
93+ CC : clang
94+ CXX : clang++
95+ - build : windows-clang-cl
96+ os : windows-2019
97+ rust : stable
98+ target : x86_64-pc-windows-msvc
99+ CC : clang-cl
100+ CXX : clang-cl
75101 steps :
76- - uses : actions/checkout@v4
77- - name : Install Rust (rustup)
78- run : |
79- set -euxo pipefail
80- rustup toolchain install ${{ matrix.rust }} --no-self-update --profile minimal --target ${{ matrix.target }}
81- rustup default ${{ matrix.rust }}
82- shell : bash
83- - name : Install g++-multilib
84- run : |
85- set -e
86- # Remove the ubuntu-toolchain-r/test PPA, which is added by default.
87- # Some packages were removed, and this is causing the g++multilib
88- # install to fail. Similar issue:
89- # https://github.com/scikit-learn/scikit-learn/issues/13928.
90- sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
91- sudo apt-get update
92- sudo apt-get install g++-multilib
93- if : matrix.build == 'linux32'
94- - uses : Swatinem/rust-cache@v2
95- - run : cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }}
96- - run : cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release
97- - run : cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel
102+ - uses : actions/checkout@v4
103+ - name : Install Rust (rustup)
104+ run : |
105+ set -euxo pipefail
106+ rustup toolchain install ${{ matrix.rust }} --no-self-update --profile minimal --target ${{ matrix.target }}
107+ rustup default ${{ matrix.rust }}
108+ shell : bash
109+ - name : Install g++-multilib
110+ run : |
111+ set -e
112+ # Remove the ubuntu-toolchain-r/test PPA, which is added by default.
113+ # Some packages were removed, and this is causing the g++multilib
114+ # install to fail. Similar issue:
115+ # https://github.com/scikit-learn/scikit-learn/issues/13928.
116+ sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test
117+ sudo apt-get update
118+ sudo apt-get install g++-multilib
119+ if : matrix.build == 'linux32'
120+ - name : add clang to path
121+ if : startsWith(matrix.build, 'windows-clang')
122+ run : |
123+ echo "C:\msys64\mingw64\bin" >> "$GITHUB_PATH"
124+ echo -e "AR=llvm-ar\nRUSTFLAGS=-Clinker=lld-link\nCC=${CC}\nCXX=${CXX}" >> "$GITHUB_ENV"
125+ shell : bash
126+ env :
127+ CC : ${{ matrix.CC }}
128+ CXX : ${{ matrix.CXX }}
129+ - name : setup dev environment
130+ uses : ilammy/msvc-dev-cmd@v1
131+ if : startsWith(matrix.build, 'windows-clang')
132+ - uses : Swatinem/rust-cache@v2
133+ - run : cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }}
134+ - run : cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release
135+ - run : cargo test ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel
98136
99137 # This is separate from the matrix above because there is no prebuilt rust-std component for these targets.
100138 check-tvos :
@@ -120,37 +158,37 @@ jobs:
120158 target : x86_64-apple-tvos
121159 no_run : --no-run
122160 steps :
123- - uses : actions/checkout@v4
124- - name : Install Rust (rustup)
125- run : |
126- set -euxo pipefail
127- rustup toolchain install ${{ matrix.rust }} --no-self-update --profile minimal
128- rustup component add rust-src --toolchain ${{ matrix.rust }}
129- rustup default ${{ matrix.rust }}
130- shell : bash
131- - uses : Swatinem/rust-cache@v2
132- - run : cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }}
133- - run : cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release
134- - run : cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel
161+ - uses : actions/checkout@v4
162+ - name : Install Rust (rustup)
163+ run : |
164+ set -euxo pipefail
165+ rustup toolchain install ${{ matrix.rust }} --no-self-update --profile minimal
166+ rustup component add rust-src --toolchain ${{ matrix.rust }}
167+ rustup default ${{ matrix.rust }}
168+ shell : bash
169+ - uses : Swatinem/rust-cache@v2
170+ - run : cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }}
171+ - run : cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --release
172+ - run : cargo test -Z build-std=std ${{ matrix.no_run }} --workspace --target ${{ matrix.target }} --features parallel
135173
136174 cuda :
137175 name : Test CUDA support
138176 runs-on : ubuntu-20.04
139177 steps :
140- - uses : actions/checkout@v4
141- - name : Install cuda-minimal-build-11-8
142- shell : bash
143- run : |
144- # https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network
145- wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
146- sudo dpkg -i cuda-keyring_1.0-1_all.deb
147- sudo apt-get update
148- sudo apt-get -y install cuda-minimal-build-11-8
149- - uses : Swatinem/rust-cache@v2
150- - name : Test 'cudart' feature
151- shell : bash
152- run : |
153- PATH="/usr/local/cuda/bin:$PATH" cargo test --manifest-path dev-tools/cc-test/Cargo.toml --features test_cuda
178+ - uses : actions/checkout@v4
179+ - name : Install cuda-minimal-build-11-8
180+ shell : bash
181+ run : |
182+ # https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network
183+ wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
184+ sudo dpkg -i cuda-keyring_1.0-1_all.deb
185+ sudo apt-get update
186+ sudo apt-get -y install cuda-minimal-build-11-8
187+ - uses : Swatinem/rust-cache@v2
188+ - name : Test 'cudart' feature
189+ shell : bash
190+ run : |
191+ PATH="/usr/local/cuda/bin:$PATH" cargo test --manifest-path dev-tools/cc-test/Cargo.toml --features test_cuda
154192
155193 msrv :
156194 name : MSRV
@@ -160,42 +198,42 @@ jobs:
160198 matrix :
161199 os : [ubuntu-latest, windows-latest]
162200 steps :
163- - uses : actions/checkout@v4
164- - name : Install Rust
165- run : |
166- rustup toolchain install 1.53.0 --no-self-update --profile minimal
167- rustup toolchain install nightly --no-self-update --profile minimal
168- rustup default 1.53.0
169- shell : bash
170- - name : Create Cargo.lock with minimal version
171- run : cargo +nightly update -Zminimal-versions
172- - name : Cache downloaded crates since 1.53 is really slow in fetching
173- uses : Swatinem/rust-cache@v2
174- - run : cargo check --lib -p cc --locked
175- - run : cargo check --lib -p cc --locked --all-features
201+ - uses : actions/checkout@v4
202+ - name : Install Rust
203+ run : |
204+ rustup toolchain install 1.53.0 --no-self-update --profile minimal
205+ rustup toolchain install nightly --no-self-update --profile minimal
206+ rustup default 1.53.0
207+ shell : bash
208+ - name : Create Cargo.lock with minimal version
209+ run : cargo +nightly update -Zminimal-versions
210+ - name : Cache downloaded crates since 1.53 is really slow in fetching
211+ uses : Swatinem/rust-cache@v2
212+ - run : cargo check --lib -p cc --locked
213+ - run : cargo check --lib -p cc --locked --all-features
176214
177215 clippy :
178216 name : Clippy
179217 runs-on : ubuntu-latest
180218 steps :
181- - uses : actions/checkout@v4
182- - name : Install Rust
183- run : |
184- rustup toolchain install stable --no-self-update --profile minimal --component rustfmt
185- rustup default stable
186- shell : bash
187- - uses : Swatinem/rust-cache@v2
188- - run : cargo clippy
219+ - uses : actions/checkout@v4
220+ - name : Install Rust
221+ run : |
222+ rustup toolchain install stable --no-self-update --profile minimal --component rustfmt
223+ rustup default stable
224+ shell : bash
225+ - uses : Swatinem/rust-cache@v2
226+ - run : cargo clippy
189227
190228 rustfmt :
191229 name : Rustfmt
192230 runs-on : ubuntu-latest
193231 steps :
194- - uses : actions/checkout@v4
195- - name : Install Rust
196- run : |
197- rustup toolchain install stable --no-self-update --profile minimal --component rustfmt
198- rustup default stable
199- shell : bash
200- - uses : Swatinem/rust-cache@v2
201- - run : cargo fmt -- --check
232+ - uses : actions/checkout@v4
233+ - name : Install Rust
234+ run : |
235+ rustup toolchain install stable --no-self-update --profile minimal --component rustfmt
236+ rustup default stable
237+ shell : bash
238+ - uses : Swatinem/rust-cache@v2
239+ - run : cargo fmt -- --check
0 commit comments