@@ -28,23 +28,18 @@ jobs:
28
28
# https://sourceforge.net/p/mingw-w64/wiki2/Exception%20Handling
29
29
#
30
30
image : [macos-latest, ubuntu-latest]
31
- version : [stable, nightly]
32
31
target : [x86_64-pc-windows-gnu, aarch64-pc-windows-gnullvm, x86_64-pc-windows-gnullvm, i686-pc-windows-gnullvm]
33
32
runs-on : ${{ matrix.image }}
34
33
35
34
steps :
36
35
- name : Checkout
37
36
uses : actions/checkout@v4
38
37
38
+ - name : Update toolchain
39
+ run : rustup update --no-self-update stable && rustup default stable
40
+
39
41
- name : Add toolchain target
40
42
run : rustup target add ${{ matrix.target }}
41
- if : contains(matrix.target, 'gnullvm') == false
42
-
43
- - name : Add nightly toolchain with gnullvm target
44
- run : |
45
- rustup default ${{ matrix.version }}
46
- rustup target add ${{ matrix.target }}
47
- if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly'
48
43
49
44
- name : Install gcc-mingw-w64-x86-64
50
45
run : sudo apt-get install -y gcc-mingw-w64-x86-64
@@ -57,37 +52,28 @@ jobs:
57
52
- name : LLVM MinGW toolchain cache configuration
58
53
id : cache-llvm-mingw-toolchain
59
54
uses : actions/cache@v4
60
- if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly'
55
+ if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm')
61
56
with :
62
57
path : ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}
63
58
key : ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}
64
59
65
60
- name : Install LLVM MinGW toolchain
66
- if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly' && steps.cache-llvm-mingw-toolchain.outputs.cache-hit != 'true'
61
+ if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && steps.cache-llvm-mingw-toolchain.outputs.cache-hit != 'true'
67
62
run : |
68
63
curl -L -o ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz https://github.com/mstorsjo/llvm-mingw/releases/download/20220906/${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz
69
64
tar -xf ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz
70
65
echo "${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH
71
66
72
67
- name : Add LLVM MinGW toolchain to PATH
73
- if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly'
68
+ if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm')
74
69
run : |
75
70
echo "${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH
76
71
77
72
- name : Test
78
73
shell : pwsh
74
+ if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') || endsWith(matrix.target, 'gnu')
79
75
run : |
80
76
cargo test --no-run --target ${{ matrix.target }} -p test_win32
81
77
if (-Not (Resolve-Path "target/*/debug/deps/test_win32-*.exe" | Test-Path)) {
82
78
throw "Failed to find test_win32 executable."
83
79
}
84
- if : contains(matrix.target, 'gnullvm') == false
85
-
86
- - name : Test gnullvm
87
- shell : pwsh
88
- run : |
89
- cargo test --no-run --target ${{ matrix.target }} -p test_win32
90
- if (-Not (Resolve-Path "target/*/debug/deps/test_win32-*.exe" | Test-Path)) {
91
- throw "Failed to find test_win32 executable."
92
- }
93
- if : startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly'
0 commit comments