-
Notifications
You must be signed in to change notification settings - Fork 118
185 lines (185 loc) · 6.45 KB
/
windows-alt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: Windows Alternative Compilers
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
mingw:
if: github.repository_owner == 'aws'
runs-on: windows-latest
steps:
- name: Install NASM
uses: ilammy/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Setup MinGW
uses: egor-tensin/[email protected]
id: setup_mingw
with:
static: 0
- name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: ${{ steps.setup_mingw.outputs.gcc }}
cxx-compiler: ${{ steps.setup_mingw.outputs.gxx }}
options: |
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=x86_64 \
CMAKE_BUILD_TOOL=C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin/ninja.exe \
CMAKE_FIND_ROOT_PATH=C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64 \
CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER \
CMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all
- name: Run tests
run: cmake --build ./build --target run_tests
clang:
if: github.repository_owner == 'aws'
runs-on: windows-latest
steps:
- name: Install NASM
uses: ilammy/[email protected]
- name: Checkout
uses: actions/checkout@v4
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v2
id: clang
with:
version: 17
env: true
- name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: "C:/Program Files/LLVM/bin/clang.exe"
cxx-compiler: "C:/Program Files/LLVM/bin/clang++.exe"
options: |
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=x86_64 \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all
- name: Run tests
run: cmake --build ./build --target run_tests
clang-cl-msbuild:
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
target:
- x64
- x64_arm64
runs-on: windows-latest
env:
CMAKE_GENERATOR: "Visual Studio 17 2022"
CMAKE_GENERATOR_TOOLSET: "ClangCL,host=x64"
steps:
- if: ${{ matrix.target == 'x64' }}
name: Install NASM
uses: ilammy/[email protected]
- name: Checkout
uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: ${{ matrix.target }}
- if: ${{ matrix.target == 'x64' }}
name: Setup CMake
uses: threeal/[email protected]
with:
options: |
CMAKE_BUILD_TYPE=Release \
- if: ${{ matrix.target == 'x64_arm64' }}
name: Setup CMake
uses: threeal/[email protected]
with:
options: |
CMAKE_GENERATOR_PLATFORM=ARM64 \
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=ARM64 \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all_tests
- if: ${{ matrix.target == 'x64' }}
name: Run tests
run: cmake --build ./build --target run_tests
clang-cl-ninja:
if: github.repository_owner == 'aws'
strategy:
fail-fast: false
matrix:
target:
- x64
- x64_arm64
runs-on: windows-latest
steps:
- if: ${{ matrix.target == 'x64' }}
name: Install NASM
uses: ilammy/[email protected]
- name: Remove wrong clang-cl.exe
run: rm "C:/Program Files/LLVM/bin/clang-cl.exe"
- name: Checkout
uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: ${{ matrix.target }}
- if: ${{ matrix.target == 'x64' }}
name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: clang-cl
cxx-compiler: clang-cl
options: |
CMAKE_BUILD_TYPE=Release \
- if: ${{ matrix.target == 'x64_arm64' }}
name: Setup CMake
uses: threeal/[email protected]
with:
generator: Ninja
c-compiler: clang-cl
cxx-compiler: clang-cl
options: |
CMAKE_SYSTEM_NAME=Windows \
CMAKE_SYSTEM_PROCESSOR=ARM64 \
CMAKE_C_COMPILER_TARGET=arm64-pc-windows-msvc \
CMAKE_ASM_COMPILER_TARGET=arm64-pc-windows-msvc \
CMAKE_CXX_COMPILER_TARGET=arm64-pc-windows-msvc \
CMAKE_BUILD_TYPE=Release \
- name: Build Project
run: cmake --build ./build --target all
- if: ${{ matrix.target == 'x64' }}
name: Run tests
run: cmake --build ./build --target run_tests
cross-mingw:
if: github.repository_owner == 'aws'
runs-on: ubuntu-22.04
steps:
- name: Install Tools
run: |
set -ex
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
sudo apt-get install --assume-yes --no-install-recommends software-properties-common
sudo add-apt-repository --yes ppa:longsleep/golang-backports
sudo dpkg --add-architecture i386
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
sudo apt-get install --assume-yes --no-install-recommends build-essential cmake golang-go nasm clang wget mingw-w64
sudo apt-get install --assume-yes --install-recommends winehq-stable wine-binfmt
sudo update-binfmts --display
sudo update-binfmts --disable
sudo update-binfmts --enable wine
sudo update-binfmts --display
sudo rm -rf /tmp/*
- uses: actions/checkout@v4
- name: x86_64-w64-mingw32 Build/Test
run:
./tests/ci/run_cross_mingw_tests.sh x86_64 w64-mingw32 "-DCMAKE_BUILD_TYPE=Release"