diff --git a/.github/workflows/windows-check.yml b/.github/workflows/windows-check.yml index aed2420d..35ba8644 100644 --- a/.github/workflows/windows-check.yml +++ b/.github/workflows/windows-check.yml @@ -220,3 +220,71 @@ jobs: if ($LASTEXITCODE -ne 0) { throw "$t failed under ASAN (exit $LASTEXITCODE)" } } + # Build and run the autotools regression tests under MSYS2 MinGW64. MinGW + # defines _WIN32, so wolfssh/settings.h turns on USE_WINDOWS_API and the + # Windows-only coverage in tests/regress.c (TestSftpWindowsOpenFlagMatrix, + # which walks the RecvOpen CREAT/EXCL/TRUNC/APPEND matrix against the + # CreateFile() disposition table) actually compiles and runs. The MSVC + # solution has no regress project and regress.c does not build with cl (it + # uses arpa/inet.h and unistd.h), so without this job that matrix runs in no + # CI at all. wolfsshd is left out of the build: its autotools path is not + # MinGW-clean and the MSVC solution already covers it. + mingw-regress: + name: MSYS2 MinGW64 regression tests + runs-on: windows-latest + timeout-minutes: 40 + + defaults: + run: + shell: msys2 {0} + + steps: + - name: Set up MSYS2 MinGW64 + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: false + install: >- + base-devel + autotools + git + mingw-w64-x86_64-gcc + mingw-w64-x86_64-pkgconf + + - name: Checkout wolfssl + uses: actions/checkout@v4 + with: + repository: wolfssl/wolfssl + path: wolfssl + + - name: Build and install wolfssl + working-directory: wolfssl + run: | + ./autogen.sh + # --enable-all pulls in --enable-crl-monitor, which wolfSSL's configure + # rejects on MinGW (it is limited to linux, OS X, and freebsd). Turn it + # back off explicitly; wolfSSH does not use the CRL monitor. + ./configure --enable-all --disable-crl-monitor \ + --enable-static --disable-shared \ + --prefix="$HOME/wolfssl-install" + make -j$(nproc) + make install + + - name: Checkout wolfssh + uses: actions/checkout@v4 + with: + path: wolfssh + + - name: Build and run the regression tests + working-directory: wolfssh + run: | + # Run autoreconf directly instead of ./autogen.sh: for a git checkout + # autogen.sh exports WARNINGS="all,error", turning autotools warnings + # into errors that the MSYS2 automake can trip on. + autoreconf -ivf + ./configure --enable-sftp \ + CPPFLAGS="-I$HOME/wolfssl-install/include" \ + LDFLAGS="-L$HOME/wolfssl-install/lib" + make -j$(nproc) tests/regress.test tests/unit.test + ./tests/regress.test + ./tests/unit.test