Skip to content

Commit

Permalink
Improved CI workflow for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
olszomal committed Dec 5, 2024
1 parent 2f7d863 commit f604d61
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 6 deletions.
63 changes: 57 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,30 @@ jobs:
fail-fast: false
matrix:
include:
- arch: 'x86'
- id: windows-x86-vs
triplet: x86-windows
build_for: 'WIN32'
- arch: 'x64'
compiler: vs
arch: x86
os: windows-latest
generator: Ninja
vcpkg_root: C:/vcpkg
- id: windows-x64-vs
triplet: x64-windows
build_for: 'WIN64'
compiler: vs
arch: x64
os: windows-latest
generator: Ninja
vcpkg_root: C:/vcpkg
- id: windows-x64-mingw
triplet: x64-windows
build_for: 'WIN64'
compiler: mingw
arch: x64
os: windows-latest
generator: Ninja
vcpkg_root: C:/vcpkg

runs-on: windows-latest

Expand All @@ -108,25 +128,56 @@ jobs:
uses: actions/cache@v4
with:
path: C:/Users/runneradmin/AppData/Local/vcpkg/archives
key: ${{matrix.arch}}
key: ${{matrix.id}}-${{hashFiles('vcpkg.json')}}
restore-keys: |
${{matrix.id}}-${{hashFiles('vcpkg.json')}}
${{matrix.id}}-
- name: Configure Visual Studio
if: matrix.compiler == 'vs'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.arch}}

- name: Install MSYS2
if: matrix.compiler == 'mingw'
uses: msys2/setup-msys2@v2
with:
update: true
install: mingw-w64-x86_64-ninja

- name: Put MSYS2_MinGW64 on PATH
if: matrix.compiler == 'mingw'
run: echo "D:/a/_temp/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install OpenSSL with VCPKG
run: |
vcpkg install --triplet=${{matrix.arch}}-windows openssl
echo "C:\vcpkg\packages\openssl_${{matrix.arch}}-windows\tools\openssl" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
vcpkg install --triplet=${{matrix.triplet}} openssl
echo "C:\vcpkg\packages\openssl_${{matrix.triplet}}\tools\openssl" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: System information
run: openssl version -a

- name: Build
if: matrix.compiler == 'vs'
run: nmake -f Makefile.mak
BUILD_FOR=${{matrix.build_for}}
OPENSSL_DIR="C:\vcpkg\packages\openssl_${{matrix.arch}}-windows"
OPENSSL_DIR="C:\vcpkg\packages\openssl_${{matrix.triplet}}"

- name: Build
if: matrix.compiler == 'mingw'
run: make -f Makefile.mingw
BUILD_FOR=${{matrix.build_for}}
OPENSSL_DIR="C:/vcpkg/packages/openssl_${{matrix.triplet}}"

- name: Test
if: matrix.compiler == 'mingw'
timeout-minutes: 5
run: make check

- name: Results of tests
if: matrix.compiler == 'mingw'
run: cat /tests/test-suite.log || true

- name: Upload the DLLs
uses: actions/upload-artifact@v4
Expand Down
11 changes: 11 additions & 0 deletions Makefile.mingw
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

SUBDIRS = src

all::

all depend install clean::
@echo "Building all in $(SUBDIRS)"
@for i in $(SUBDIRS); do \
(cd $$i && $(MAKE) BUILD_FOR=$(BUILD_FOR) OPENSSL_DIR=$(OPENSSL_DIR)); \
done

0 comments on commit f604d61

Please sign in to comment.