Skip to content

Commit 2966aa4

Browse files
authored
Merge pull request #64 from LebedevRI/cross
CI: move windows msvc jobs to linux cross too
2 parents a38a1ad + f30c0c1 commit 2966aa4

File tree

3 files changed

+58
-175
lines changed

3 files changed

+58
-175
lines changed

.github/workflows/CI-linux.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ env:
4545
RUSTFLAGS: "-Dwarnings"
4646
SRC_DIR: ${{ github.workspace }}/rawspeed.rs
4747
CODECOV_TOKEN_EXISTS: ${{ secrets.CODECOV_TOKEN != '' }}
48-
CODE_COVERAGE_SUPPORTED: ${{ inputs.flavor != 'RustFmt' && inputs.flavor != 'doc' && inputs.target-os != 'windows' }}
48+
CODE_COVERAGE_SUPPORTED: ${{ inputs.flavor != 'RustFmt' && inputs.flavor != 'doc' && (inputs.target-os != 'windows' || inputs.rust-toolchain-abi == 'msvc') }}
4949

5050
jobs:
5151
linux:
@@ -180,6 +180,7 @@ jobs:
180180
ln -s /usr/bin/clang-${{ inputs.distro-LLVM }} /usr/local/bin/clang
181181
ln -s /usr/bin/clang++-${{ inputs.distro-LLVM }} /usr/local/bin/clang++
182182
ln -s /usr/bin/ld.lld-${{ inputs.distro-LLVM }} /usr/local/bin/ld.lld
183+
ln -s /usr/bin/lld-link-${{ inputs.distro-LLVM }} /usr/local/bin/lld-link
183184
ln -s /usr/local/bin/clang /usr/local/bin/cc
184185
ln -s /usr/local/bin/clang /usr/local/bin/gcc
185186
ln -s /usr/local/bin/clang++ /usr/local/bin/c++
@@ -232,22 +233,36 @@ jobs:
232233
if [ "${{ inputs.builder-target }}" = "i686" ]; then
233234
eatmydata dpkg --add-architecture i386
234235
fi
236+
if [ "${{ inputs.rust-toolchain-abi }}" = "gnu" ]; then
235237
PACKAGES="${PACKAGES} \
236238
mingw-w64 \
239+
"
240+
fi
241+
PACKAGES="${PACKAGES} \
237242
wine \
238243
"
239244
if [ "${{ inputs.builder-target }}" = "i686" ]; then
240245
PACKAGES="${PACKAGES} \
241246
wine32:i386 \
242247
"
243248
fi
249+
if [ "${{ inputs.rust-toolchain-abi }}" = "msvc" ]; then
250+
PACKAGES="${PACKAGES} \
251+
python3 msitools \
252+
"
253+
fi
244254
mkdir -p "$HOME/.cargo" && tee -a "$HOME/.cargo/config.toml" > /dev/null <<EOT
245255
[target.${{ env.RUST_TARGET }}]
246256
runner = "wine"
247257
EOT
258+
if [ "${{ inputs.rust-toolchain-abi }}" = "msvc" ]; then
259+
mkdir -p "$HOME/.cargo" && tee -a "$HOME/.cargo/config.toml" > /dev/null <<EOT
260+
linker = "lld-link"
261+
EOT
262+
fi
248263
echo "PACKAGES=$(echo ${PACKAGES})" >> $GITHUB_ENV
249264
- name: Install the packages
250-
timeout-minutes: 1
265+
timeout-minutes: 2
251266
run: |
252267
set -xe
253268
rm -rf /var/lib/apt/lists/*
@@ -282,6 +297,36 @@ jobs:
282297
. "$HOME/.cargo/env"
283298
eatmydata rustup component add llvm-tools-preview
284299
eatmydata cargo install cargo-llvm-cov
300+
- name: Fetch/Checkout msvc-wine git repo
301+
timeout-minutes: 1
302+
if: inputs.target-os == 'windows' && inputs.rust-toolchain-abi == 'msvc'
303+
uses: actions/checkout@v4
304+
with:
305+
repository: 'mstorsjo/msvc-wine'
306+
path: 'msvc-wine'
307+
fetch-depth: 1
308+
set-safe-directory: ${{ github.workspace }}
309+
- name: Perform msvc-wine stuff
310+
timeout-minutes: 2
311+
if: inputs.target-os == 'windows' && inputs.rust-toolchain-abi == 'msvc'
312+
run: |
313+
set -xe
314+
. "$HOME/.cargo/env"
315+
cd msvc-wine
316+
if [ "${{ inputs.builder-target }}" = "x86_64" ]; then
317+
MSVC_ARCH=x64
318+
elif [ "${{ inputs.builder-target }}" = "i686" ]; then
319+
MSVC_ARCH=x86
320+
elif [ "${{ inputs.builder-target }}" = "aarch64" ]; then
321+
MSVC_ARCH=arm64
322+
else
323+
exit 1
324+
fi
325+
PYTHONUNBUFFERED=1 ./vsdownload.py --accept-license --dest /opt/msvc
326+
./install.sh /opt/msvc
327+
tee -a "$HOME/.cargo/env" > /dev/null <<EOT
328+
BIN=/opt/msvc/bin/${MSVC_ARCH} . $(pwd)/msvcenv-native.sh
329+
EOT
285330
- name: Fetch/Checkout RawSpeed.RS git repo
286331
timeout-minutes: 1
287332
uses: actions/checkout@v4

.github/workflows/CI-windows-msys2.yml

Lines changed: 0 additions & 146 deletions
This file was deleted.

.github/workflows/CI.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,19 @@ jobs:
4444
matrix:
4545
os: [ linux ]
4646
stack:
47-
- { runs-on: "ubuntu-latest", host: "x86_64", target: "x86_64", vendor: "pc", os: "windows" }
48-
- { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "pc", os: "windows" }
47+
- { runs-on: "ubuntu-latest", host: "x86_64", target: "x86_64", vendor: "pc", os: "windows" }
48+
- { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "pc", os: "windows" }
49+
- { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "pc", os: "windows" }
4950
distro:
5051
- { image: "debian:trixie-slim", LLVM: 19 }
51-
abi: [ gnu ]
52+
abi: [ gnu, msvc ]
5253
rust-toolchain-name: [ stable, nightly ]
5354
flavor: [ dev, release ]
55+
exclude:
56+
- stack: { runs-on: "ubuntu-24.04-arm", host: "aarch64", target: "aarch64", vendor: "pc", os: "windows" }
57+
abi: gnu
58+
- stack: { runs-on: "ubuntu-latest", host: "x86_64", target: "i686", vendor: "pc", os: "windows" }
59+
abi: msvc
5460
uses: ./.github/workflows/CI-linux.yml
5561
with:
5662
os: ${{ matrix.os }}
@@ -67,7 +73,7 @@ jobs:
6773
secrets:
6874
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6975
linux-cross:
70-
needs: [ linux-fast, windows-cross, windows-msys2-fast, macOS-fast ]
76+
needs: [ linux-fast, windows-cross, macOS-fast ]
7177
strategy:
7278
fail-fast: false
7379
matrix:
@@ -99,28 +105,6 @@ jobs:
99105
flavor: ${{ matrix.flavor }}
100106
secrets:
101107
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
102-
windows-msys2-fast:
103-
strategy:
104-
fail-fast: false
105-
matrix:
106-
stack:
107-
- { os: windows, os-ver: latest, host: "x86_64", target: "x86_64", msystem: CLANG64 }
108-
- { os: windows, os-ver: 11-arm, host: "aarch64", target: "aarch64", msystem: CLANGARM64 }
109-
rust-toolchain-version: [ stable, nightly ]
110-
rust-toolchain-abi: [ msvc ]
111-
flavor: [ dev, release ]
112-
uses: ./.github/workflows/CI-windows-msys2.yml
113-
with:
114-
os: ${{ matrix.stack.os }}
115-
runs-on: ${{ matrix.stack.os }}-${{ matrix.stack.os-ver }}
116-
builder-host: ${{ matrix.stack.host }}
117-
builder-target: ${{ matrix.stack.target }}
118-
msys2-msystem: ${{ matrix.stack.msystem }}
119-
rust-toolchain-version: ${{ matrix.rust-toolchain-version }}
120-
rust-toolchain-abi: ${{ matrix.rust-toolchain-abi }}
121-
flavor: ${{ matrix.flavor }}
122-
secrets:
123-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
124108
macOS-fast:
125109
strategy:
126110
fail-fast: false
@@ -143,7 +127,7 @@ jobs:
143127
secrets:
144128
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
145129
build-docs:
146-
needs: [ linux-fast, windows-cross, linux-cross, windows-msys2-fast, macOS-fast ]
130+
needs: [ linux-fast, windows-cross, linux-cross, macOS-fast ]
147131
uses: ./.github/workflows/CI-linux.yml
148132
with:
149133
os: linux

0 commit comments

Comments
 (0)