Skip to content

Commit 5f28fa9

Browse files
TerrorJacksunfishcode
authored andcommitted
Use msys clang toolchain to build windows binaries
1 parent f4a0844 commit 5f28fa9

File tree

1 file changed

+29
-26
lines changed

1 file changed

+29
-26
lines changed

.github/workflows/main.yml

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,42 +42,45 @@ jobs:
4242

4343
winbuild:
4444
name: Windows Build
45-
runs-on: windows-2019
45+
runs-on: windows-latest
4646
strategy:
4747
fail-fast: false
4848
matrix:
49-
arch:
50-
- x64
51-
- x86
52-
env:
53-
MSYS2_PATH_TYPE: inherit
54-
MSYSTEM: MINGW64
55-
CC: cl
56-
CXX: cl
57-
NINJA_FLAGS: -v
49+
include:
50+
- arch: x64
51+
sys: clang64
52+
env: clang-x86_64
53+
- arch: x86
54+
sys: clang32
55+
env: clang-i686
5856
steps:
59-
- uses: actions/checkout@v1
57+
- uses: msys2/setup-msys2@v2
58+
with:
59+
install: >-
60+
base-devel
61+
git
62+
mingw-w64-${{ matrix.env }}-cmake
63+
mingw-w64-${{ matrix.env }}-ninja
64+
mingw-w64-${{ matrix.env }}-toolchain
65+
msystem: ${{ matrix.sys }}
66+
update: true
67+
release: false
68+
- uses: actions/checkout@v3
6069
with:
70+
fetch-depth: 0
6171
submodules: true
62-
- name: Install ninja (Windows)
63-
run: choco install ninja
6472
- name: Build
65-
shell: cmd
66-
# vcvarsall.bat need explicit Visual Studio 2019 to be installed
73+
shell: msys2 {0}
6774
run: |
68-
set "HOME=%CD%"
69-
set CL_ARCH=${{ fromJson('{ "x86": "amd64_x86", "x64": "amd64" }')[matrix.arch] }}
70-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %CL_ARCH%
71-
C:\msys64\usr\bin\bash.exe --login -c "make package"
72-
- name: Run the testsuite
73-
shell: cmd
75+
make package
76+
make check
77+
- name: Does it work sans msys2?
7478
run: |
75-
set "HOME=%CD%"
76-
set CL_ARCH=${{ fromJson('{ "x86": "amd64_x86", "x64": "amd64" }')[matrix.arch] }}
77-
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %CL_ARCH%
78-
C:\msys64\usr\bin\bash.exe --login -c "make check"
79+
C:\wasi-sdk\bin\clang.exe --version
80+
C:\wasi-sdk\bin\llvm-ar.exe --version
81+
C:\wasi-sdk\bin\wasm-ld.exe --version
7982
- name: Upload artifacts
80-
uses: actions/upload-artifact@v1
83+
uses: actions/upload-artifact@v3
8184
with:
8285
# Upload the dist folder. Give it a name according to the OS it was built for.
8386
name: ${{ format( 'dist-windows-latest-{0}', matrix.arch) }}

0 commit comments

Comments
 (0)