github: Move CI for Windows from AppVeyor to GitHub Actions

These are quite a bit faster than on AppVeyor (with ccache about a fifth,
without less than half - and they run concurrently).

We only keep the AppVeyor builds for now to test against those old
OpenSSL versions (1.1.1 and 1.0.2) for which there is still extended
support available.  Even simplified like that they still take longer
than the builds on GA.
This commit is contained in:
Tobias Brunner
2026-04-21 16:44:18 +02:00
parent e0fb06c9cc
commit 19d73ef156
2 changed files with 85 additions and 15 deletions
+53 -2
View File
@@ -8,7 +8,6 @@ concurrency:
env: env:
TESTS_REDUCED_KEYLENGTHS: yes TESTS_REDUCED_KEYLENGTHS: yes
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_COMPRESS: true CCACHE_COMPRESS: true
CCACHE_MAXSIZE: 200M CCACHE_MAXSIZE: 200M
# since the compilers are newly installed every time, we have to use this to # since the compilers are newly installed every time, we have to use this to
@@ -35,6 +34,7 @@ jobs:
matrix: matrix:
test: [ win64, win32 ] test: [ win64, win32 ]
env: env:
CCACHE_BASEDIR: ${{ github.workspace }}
OS_NAME: linux OS_NAME: linux
TEST: ${{ matrix.test }} TEST: ${{ matrix.test }}
steps: steps:
@@ -48,7 +48,7 @@ jobs:
- run: | - run: |
sudo apt-get install -qq ccache sudo apt-get install -qq ccache
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
ccache -z ccache -sz
- uses: ./.github/actions/default - uses: ./.github/actions/default
- run: ccache -s - run: ccache -s
- if: ${{ failure() }} - if: ${{ failure() }}
@@ -57,3 +57,54 @@ jobs:
name: Logs ${{ github.job }} name: Logs ${{ github.job }}
path: config.log path: config.log
retention-days: 5 retention-days: 5
native:
needs: pre-check
if: ${{ needs.pre-check.outputs.should_skip != 'true' }}
runs-on: windows-latest
strategy:
matrix:
include:
- msystem: mingw64
arch: x86_64
test: win64
- msystem: mingw32
arch: i686
test: win32
env:
OS_NAME: windows
TEST: ${{ matrix.test }}
defaults:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
- run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v6
- uses: actions/cache@v5
with:
path: ~\AppData\Local\ccache
key: ccache-${{ runner.os }}-${{ matrix.test }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-${{ matrix.test }}-
- run: |
pacman --noconfirm -S --needed mingw-w64-${{ matrix.arch }}-ccache
ccache -sz
- run: ./scripts/test.sh deps
# GITHUB_ENV doesn't work, so set PATH here
- name: Build and run tests
run: |
PATH=/${{ matrix.msystem }}/lib/ccache/bin:$PATH
./scripts/test.sh
# sometimes streaming/threading tests hang completely
timeout-minutes: 30
- run: ccache -s
- if: ${{ failure() }}
uses: actions/upload-artifact@v6
with:
name: Logs ${{ github.job }}
path: config.log
retention-days: 5
+32 -13
View File
@@ -345,14 +345,9 @@ win*)
--enable-tnccs-20 --enable-tnccs-20
--enable-pki --enable-swanctl --enable-socket-win --enable-pki --enable-swanctl --enable-socket-win
--enable-kernel-iph --enable-kernel-wfp --enable-winhttp" --enable-kernel-iph --enable-kernel-wfp --enable-winhttp"
# no make check for Windows binaries unless we run on a Windows host # on AppVeyor we only build against old OpenSSL versions
# building natively is slow, so don't build libimcv to save about 10 minutes if test "$APPVEYOR" = "True"; then
if test "$APPVEYOR" != "True"; then CONFIG="--disable-defaults --enable-static --enable-pki --enable-openssl --enable-pem --enable-drbg"
TARGET=
CONFIG="$CONFIG --enable-imc-attestation --enable-imv-attestation
--enable-imc-os --enable-imv-os --enable-tnc-imv --enable-tnc-imc"
else
CONFIG="$CONFIG --enable-openssl"
CFLAGS="$CFLAGS -I$OPENSSL_DIR/include" CFLAGS="$CFLAGS -I$OPENSSL_DIR/include"
LDFLAGS="-L$OPENSSL_DIR/lib -fuse-ld=lld" LDFLAGS="-L$OPENSSL_DIR/lib -fuse-ld=lld"
case "$IMG" in case "$IMG" in
@@ -362,19 +357,40 @@ win*)
;; ;;
esac esac
export LDFLAGS export LDFLAGS
# no make check for Windows binaries unless we run on a Windows host
# building natively is slow, so don't build libimcv to save several minutes
elif test "$OS_NAME" != "windows"; then
TARGET=
CONFIG="$CONFIG --enable-imc-attestation --enable-imv-attestation
--enable-imc-os --enable-imv-os --enable-tnc-imv --enable-tnc-imc"
DEPS="gcc-mingw-w64-base"
case "$TEST" in
win64)
DEPS="gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev $DEPS"
;;
win32)
DEPS="gcc-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-i686-dev $DEPS"
;;
esac
else
CONFIG="$CONFIG --enable-openssl --enable-drbg"
DEPS="base-devel git autotools gperf"
case "$TEST" in
win64)
DEPS="$DEPS mingw-w64-x86_64-toolchain"
;;
win32)
DEPS="$DEPS mingw-w64-i686-toolchain"
;;
esac
fi fi
CFLAGS="$CFLAGS -mno-ms-bitfields" CFLAGS="$CFLAGS -mno-ms-bitfields"
DEPS="gcc-mingw-w64-base"
case "$TEST" in case "$TEST" in
win64) win64)
CONFIG="--host=x86_64-w64-mingw32 $CONFIG --enable-dbghelp-backtraces" CONFIG="--host=x86_64-w64-mingw32 $CONFIG --enable-dbghelp-backtraces"
DEPS="gcc-mingw-w64-x86-64 binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev $DEPS"
CC="x86_64-w64-mingw32-gcc"
;; ;;
win32) win32)
CONFIG="--host=i686-w64-mingw32 $CONFIG" CONFIG="--host=i686-w64-mingw32 $CONFIG"
DEPS="gcc-mingw-w64-i686 binutils-mingw-w64-i686 mingw-w64-i686-dev $DEPS"
CC="i686-w64-mingw32-gcc"
;; ;;
esac esac
;; ;;
@@ -498,6 +514,9 @@ deps)
pkg install -y automake autoconf libtool pkgconf && \ pkg install -y automake autoconf libtool pkgconf && \
pkg install -y bison flex gperf $DEPS pkg install -y bison flex gperf $DEPS
;; ;;
windows)
pacman --noconfirm -S --needed $DEPS
;;
esac esac
exit $? exit $?
;; ;;