Skip to content

Commit 5d490b8

Browse files
committed
CI: add Stable, optimize (spilt up + parallelize windows builds)
1 parent bec501f commit 5d490b8

File tree

10 files changed

+125
-38
lines changed

10 files changed

+125
-38
lines changed

.github/workflows/rust.yml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,44 @@ jobs:
3232
cargo -V
3333
- name: Test
3434
run: cargo test
35-
build-windows:
36-
name: Windows 2019 Server
35+
build-windows-nightly-x64:
36+
name: Windows 2019 Server (≈Nightly, x64)
3737
runs-on: windows-2019
3838
steps:
3939
- uses: actions/checkout@v2
40-
- name: Install
41-
run: |
42-
rustup target add x86_64-pc-windows-msvc i686-pc-windows-msvc
43-
- name: Info
44-
run: |
45-
rustc -V
46-
cargo -V
47-
cmd /C ver
48-
- name: Test
49-
run: scripts\build
40+
- {name: Install, run: rustup target add --toolchain=nightly x86_64-pc-windows-msvc }
41+
- {name: Info, run: scripts\info-nightly }
42+
- {name: Test, run: scripts\test-nightly }
43+
- {name: Docs, run: scripts\doc }
44+
build-windows-stable-x64:
45+
name: Windows 2019 Server (Stable, x64)
46+
runs-on: windows-2019
47+
steps:
48+
- uses: actions/checkout@v2
49+
- {name: Install, run: rustup update stable }
50+
- {name: Info, run: scripts\info-stable }
51+
- {name: Test, run: scripts\test-stable }
52+
build-windows-msrv-x64:
53+
name: Windows 2019 Server (MSRV, x64)
54+
runs-on: windows-2019
55+
steps:
56+
- uses: actions/checkout@v2
57+
- {name: Install, run: rustup target add x86_64-pc-windows-msvc }
58+
- {name: Info, run: scripts\info-msrv }
59+
- {name: Test, run: scripts\test-msrv }
60+
build-windows-msrv-i686:
61+
name: Windows 2019 Server (MSRV, i686)
62+
runs-on: windows-2019
63+
steps:
64+
- uses: actions/checkout@v2
65+
- {name: Install, run: rustup target add i686-pc-windows-msvc }
66+
- {name: Info, run: scripts\info-msrv }
67+
- {name: Test, run: scripts\test-msrv-i686 }
68+
build-windows-msrv-wsl:
69+
name: Windows 2019 Server (MSRV, WSL)
70+
runs-on: windows-2019
71+
steps:
72+
- uses: actions/checkout@v2
73+
- {name: Install, run: rustup target add x86_64-pc-windows-msvc }
74+
- {name: Info, run: scripts\info-msrv }
75+
- {name: Test, run: scripts\test-msrv-wsl }

scripts/build.cmd

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,25 @@
11
@pushd "%~dp0.." && setlocal
22

3+
:: Keep in sync with .github\workflows\rust.yml
34

45
:: Nightly
56
@cargo +nightly >NUL 2>NUL || ver>NUL && goto :skip-nightly
6-
@call :run-windows cargo +nightly test || goto :die
7-
@call :run-windows cargo +nightly build --all-targets || goto :die
8-
@call "scripts\doc.cmd" || goto :die
7+
@call "scripts\test-nightly.cmd" || goto :die
98
:skip-nightly
109

11-
:: Stable
12-
@call :run-windows cargo test || goto :die
13-
@call :run-windows cargo build --all-targets --release || goto :die
10+
:: MSRV
11+
@call "scripts\test-msrv.cmd" || goto :die
12+
13+
:: MSRV (i686)
14+
@call "scripts\test-msrv-i686.cmd" || goto :die
1415

15-
:: Stable (i686)
16-
@call :run-windows cargo test --target=i686-pc-windows-msvc || goto :die
17-
@call :run-windows cargo build --target=i686-pc-windows-msvc --all-targets --release || goto :die
16+
:: MSRV (WSL)
17+
@"%WINDIR%\System32\bash" --version >NUL 2>NUL || ver>NUL && goto :skip-msrv-linux
18+
@call "scripts\test-msrv-wsl.cmd" || goto :die
19+
:skip-msrv-linux
1820

19-
:: Stable (Linux)
20-
@"%WINDIR%\System32\bash" --version >NUL 2>NUL || ver>NUL && goto :skip-stable-linux
21-
@call :run-linux cargo test || goto :die
22-
@call :run-linux cargo build --all-targets --release || goto :die
23-
:skip-stable-linux
21+
:: Stable
22+
@call "scripts\test-stable.cmd" || goto :die
2423

2524
:die
2625
@popd && endlocal && exit /b %ERRORLEVEL%
27-
28-
29-
30-
:run-windows
31-
@echo %*
32-
@%*
33-
@exit /b %ERRORLEVEL%
34-
35-
:run-linux
36-
@echo bash -c '%*'
37-
@"%WINDIR%\System32\bash" --login -c '%*'
38-
@exit /b %ERRORLEVEL%

scripts/info-msrv.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
rustc +nightly -V
4+
cargo +nightly -V
5+
ver
6+
7+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/info-nightly.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
rustc -V
4+
cargo -V
5+
ver
6+
7+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/info-stable.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
rustc +stable -V
4+
cargo +stable -V
5+
ver
6+
7+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/test-msrv-i686.cmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
cargo test --target=i686-pc-windows-msvc
4+
@if ERRORLEVEL 1 goto :die
5+
6+
cargo build --target=i686-pc-windows-msvc --all-targets --release
7+
@if ERRORLEVEL 1 goto :die
8+
9+
:die
10+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/test-msrv-wsl.cmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
"%WINDIR%\System32\bash" --login -c 'cargo test'
4+
@if ERRORLEVEL 1 goto :die
5+
6+
"%WINDIR%\System32\bash" --login -c 'cargo build --all-targets --release'
7+
@if ERRORLEVEL 1 goto :die
8+
9+
:die
10+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/test-msrv.cmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
cargo test
4+
@if ERRORLEVEL 1 goto :die
5+
6+
cargo build --all-targets --release
7+
@if ERRORLEVEL 1 goto :die
8+
9+
:die
10+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/test-nightly.cmd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
cargo +nightly test
4+
@if ERRORLEVEL 1 goto :die
5+
6+
cargo +nightly build --all-targets
7+
@if ERRORLEVEL 1 goto :die
8+
9+
@call "scripts\doc.cmd"
10+
@if ERRORLEVEL 1 goto :die
11+
12+
:die
13+
@popd && endlocal && exit /b %ERRORLEVEL%

scripts/test-stable.cmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@pushd "%~dp0.." && setlocal
2+
3+
cargo +stable test
4+
@if ERRORLEVEL 1 goto :die
5+
6+
cargo +stable build --all-targets
7+
@if ERRORLEVEL 1 goto :die
8+
9+
:die
10+
@popd && endlocal && exit /b %ERRORLEVEL%

0 commit comments

Comments
 (0)