Skip to content

Commit 2ec4e06

Browse files
authored
Test cross-compilation with stable gnullvm targets (#3104)
1 parent bfb55f3 commit 2ec4e06

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

.github/workflows/cross.yml

+7-21
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,18 @@ jobs:
2828
# https://sourceforge.net/p/mingw-w64/wiki2/Exception%20Handling
2929
#
3030
image: [macos-latest, ubuntu-latest]
31-
version: [stable, nightly]
3231
target: [x86_64-pc-windows-gnu, aarch64-pc-windows-gnullvm, x86_64-pc-windows-gnullvm, i686-pc-windows-gnullvm]
3332
runs-on: ${{ matrix.image }}
3433

3534
steps:
3635
- name: Checkout
3736
uses: actions/checkout@v4
3837

38+
- name: Update toolchain
39+
run: rustup update --no-self-update stable && rustup default stable
40+
3941
- name: Add toolchain target
4042
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'
4843

4944
- name: Install gcc-mingw-w64-x86-64
5045
run: sudo apt-get install -y gcc-mingw-w64-x86-64
@@ -57,37 +52,28 @@ jobs:
5752
- name: LLVM MinGW toolchain cache configuration
5853
id: cache-llvm-mingw-toolchain
5954
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')
6156
with:
6257
path: ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}
6358
key: ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}
6459

6560
- 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'
6762
run: |
6863
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
6964
tar -xf ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz
7065
echo "${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH
7166
7267
- 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')
7469
run: |
7570
echo "${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH
7671
7772
- name: Test
7873
shell: pwsh
74+
if: startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') || endsWith(matrix.target, 'gnu')
7975
run: |
8076
cargo test --no-run --target ${{ matrix.target }} -p test_win32
8177
if (-Not (Resolve-Path "target/*/debug/deps/test_win32-*.exe" | Test-Path)) {
8278
throw "Failed to find test_win32 executable."
8379
}
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

Comments
 (0)