-
Notifications
You must be signed in to change notification settings - Fork 133
172 lines (155 loc) · 5.06 KB
/
build-and-test-msys2.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
name: "MSYS2 Build & Test"
on:
# allow direct trigger
workflow_dispatch:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
COMMON_CMAKE_FLAGS: >
-DSLEEF_BUILD_DFT=ON
-DSLEEF_BUILD_GNUABI_LIBS=ON
-DSLEEF_BUILD_QUAD=ON
-DSLEEF_BUILD_SCALAR_LIB=ON
-DSLEEF_BUILD_STATIC_TEST_BINS=ON
-DSLEEF_ENFORCE_TESTER=ON
-DSLEEF_ENFORCE_TESTER3=ON
-DSLEEF_SHOW_CONFIG=1
jobs:
build-msys2:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
sys:
- clang64
#- clangarm64
#- mingw64
#- ucrt64
lto: [lto, nlto]
#exclude:
#- sys: mingw64
#lto: lto
#- sys: ucrt64
#lto: lto
defaults:
run:
shell: msys2 {0}
name: build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
steps:
- name: Disable autocrlf
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >-
git
pacboy: >-
cc:p
cmake:p
mpfr:p
ninja:p
openssl:p
pkgconf:p
- uses: actions/[email protected]
with:
persist-credentials: false
- name: Build msys2-${{ matrix.sys }}-${{ matrix.lto }}
shell: msys2 {0}
run: |
EXTRA_CMAKE_FLAGS=""
if [[ ${{ matrix.sys }} = "clang64" ]]; then
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DSLEEF_ENFORCE_SSE2=ON -DSLEEF_ENFORCE_SSE4=ON -DSLEEF_ENFORCE_AVX=ON -DSLEEF_ENFORCE_AVX2=ON -DSLEEF_ENFORCE_AVX512F=ON -DSLEEF_ENFORCE_FMA4=ON"
[[ ${{ matrix.lto }} = "lto" ]] && EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DSLEEF_ENABLE_LTO=ON"
elif [[ ${{ matrix.sys }} = "clangarm64" ]]; then
[[ ${{ matrix.lto }} = "lto" ]] && EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DSLEEF_ENABLE_LTO=ON"
elif [[ ${{ matrix.sys }} = "mingw64" || ${{ matrix.sys }} = "ucrt64" ]]; then
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DSLEEF_ENFORCE_SSE2=ON -DSLEEF_ENFORCE_SSE4=ON -DSLEEF_ENFORCE_AVX=ON -DSLEEF_ENFORCE_AVX2=ON -DSLEEF_ENFORCE_AVX512F=ON -DSLEEF_ENFORCE_FMA4=ON"
fi
cmake -S . -B _build-msys2-${{ matrix.sys }}-${{ matrix.lto }} -GNinja \
${COMMON_CMAKE_FLAGS} \
${EXTRA_CMAKE_FLAGS} \
-DCMAKE_INSTALL_PREFIX=$(pwd)/_install-msys2-${{ matrix.sys }}-${{ matrix.lto }} \
-DOPENSSL_EXTRA_LIBRARIES="-lws2_32 -lcrypt32"
cmake --build _build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
cmake --install _build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
- name: Upload build-msys2-${{ matrix.sys }}-${{ matrix.lto }} artifacts
uses: actions/upload-artifact@v3
with:
name: build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
path: |
_build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
_install-msys2-${{ matrix.sys }}-${{ matrix.lto }}
if: always()
test-msys2:
runs-on: windows-latest
needs: [build-msys2]
strategy:
fail-fast: false
matrix:
sys:
- clang64
#- clangarm64
#- mingw64
#- ucrt64
lto: [lto, nlto]
#exclude:
#- sys: mingw64
#lto: lto
#- sys: ucrt64
#lto: lto
defaults:
run:
shell: msys2 {0}
name: test-msys2-${{ matrix.sys }}-${{ matrix.lto }}
steps:
- name: Disable autocrlf
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
update: true
install: >-
git
pacboy: >-
cc:p
cmake:p
mpfr:p
ninja:p
openssl:p
pkgconf:p
- uses: actions/[email protected]
with:
persist-credentials: false
- name: Print host CPU info
run: |
wget -qO- https://download.sysinternals.com/files/Coreinfo.zip | bsdtar -xf-
./Coreinfo64.exe -accepteula
- name: Download build-msys2-${{ matrix.sys }}-${{ matrix.lto }} artifacts
uses: actions/download-artifact@v3
with:
name: build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
- name: Test msys2-${{ matrix.sys }}-${{ matrix.lto }}
env:
CTEST_OUTPUT_ON_FAILURE: "TRUE"
run: |
cd _build-msys2-${{ matrix.sys }}-${{ matrix.lto }}
ctest -j$(nproc)
- name: Upload test-msys2-${{ matrix.sys }}-${{ matrix.lto }} artifacts
uses: actions/upload-artifact@v3
with:
name: test-msys2-${{ matrix.sys }}-${{ matrix.lto }}
path: |
_build-msys2-${{ matrix.sys }}-${{ matrix.lto }}/Testing
if: always()