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 6, 2024
1 parent 2f7d863 commit f8d94c7
Showing 1 changed file with 60 additions and 8 deletions.
68 changes: 60 additions & 8 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: 'MINGW64'
compiler: mingw
arch: x64
os: windows-latest
generator: Ninja
vcpkg_root: C:/vcpkg

runs-on: windows-latest

Expand All @@ -108,25 +128,57 @@ 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 OpenSSL with VCPKG
- 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 tools
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[tools]
echo "C:\vcpkg\packages\openssl_${{matrix.triplet}}\tools\openssl" >> $GITHUB_PATH
echo "PKG_CONFIG_PATH=C:\vcpkg\packages\openssl_${{matrix.triplet}}\lib\pkgconfig" >> $GITHUB_ENV
- name: System information
run: openssl version -a

- name: Build
- name: Build (vs)
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 (mingw)
if: matrix.compiler == 'mingw'
run: |
./configure
make
- 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

0 comments on commit f8d94c7

Please sign in to comment.