-
Notifications
You must be signed in to change notification settings - Fork 0
170 lines (141 loc) · 4.71 KB
/
ci-windows.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
# SPDX-FileCopyrightText: 2022 - 2023 Peter Urban, Ghent University
#
# SPDX-License-Identifier: CC0-1.0
name: win
on:
push:
branches: [ main ]
paths-ignore:
- '.github/workflows/python-package*'
- '.github/workflows/cibuildwheels*'
- '.github/workflows/conda*'
- '.github/workflows/test_*'
- '.github/workflows/ci-linux*'
- '.github/workflows/ci-mac*'
- 'conda.recipe/*'
- '*.md'
- 'doc/*'
#paths:
# - "**meson.build"
# - "**.cpp"
# - "**.c"
# - "**.h"
pull_request:
branches: [ main ]
paths-ignore:
- '.github/workflows/python-package*'
- '.github/workflows/cibuildwheels*'
- '.github/workflows/conda*'
- '.github/workflows/test_*'
- '.github/workflows/ci-linux*'
- '.github/workflows/ci-mac*'
- 'conda.recipe/*'
- '*.md'
- 'doc/*'
#paths:
# - "**meson.build"
# - "**.cpp"
# - "**.c"
# - "**.h"
# make sure that multiple jobs don't run for the same action (new commits cancel old jobs when they are still running)
# Souce Ralf Gommers (commit to meson-python)
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
# env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
#BUILD_TYPE: Release
jobs:
build-on-windows:
name: ${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
os: [windows-2019]
boost-version: [1.84.0]
boost-version_: [1_84_0]
boost-modules: [--with-iostreams]
include:
- toolset: vc143
compiler: clang-cl
cpp_std: c++20
# - toolset: msvc
# compiler: sccache cl
# cpp_std: c++20
env:
#CC: msvc-14.32
CC: ${{matrix.compiler}}
CXX: ${{matrix.compiler}}
#this is where we will download ninja later
NINJA: d:/ninja.exe
#container: python:latest #pull directly from dockerhub
steps:
- name: setup python
uses: actions/setup-python@v3
with:
python-version: '3.12'
# make sure meson can find msvc
- uses: TheMrMilchmann/setup-msvc-dev@v2
with:
arch: x64
#toolset: 14.34
- name: checkout main repository
uses: actions/checkout@v4
with:
submodules: recursive
lfs: false
- name: sccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: super-ci-win # name for the cache
variant: sccache # supports windows
- name: Cache Boost
id: cache-boost
uses: actions/cache@v3
with:
path: c:\Boost
#key: windows-msvc-14.32-boost-${{matrix.boost-version}}-${{matrix.boost-modules}}
key: windows-${{matrix.toolset}}-boost-${{matrix.boost-version}}-${{matrix.boost-modules}}
- name: Install dependencies on windows
if: steps.cache-boost.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://boostorg.jfrog.io/artifactory/main/release/${{matrix.boost-version}}/source/boost_${{matrix.boost-version_}}.7z -outfile boost.7z
7z x boost.7z
cd .\boost_${{matrix.boost-version_}}\
.\bootstrap.bat ${{matrix.toolset}}
.\b2.exe install --variant=release --threading=multi --link=static ${{matrix.boost-modules}}
cd ..
#rm -rv boost*
- name: install dependencies (meson & python)
run: pip install meson meson-python pytest numpy
#run: pip install meson meson-python pytest numpy ninja
- name: download ninja long path
run : |
Invoke-WebRequest -Uri https://raw.githubusercontent.com/themachinethatgoesping/tools/main/ninja-windows/ninja.exe -OutFile d:\ninja.exe
- name: check ninja executable path
run: |
$env:NINJA
d:\ninja.exe --version
- name: configure meson
run: |
meson setup builddir/ -D"python.install_env=auto" -Ddefault_library=static -D"python.install_env=auto" -Dcpp_std=${{matrix.cpp_std}}
- name: compile project
run: meson compile -C builddir/
- name: test (cpp)
#run: meson test -C builddir/ --print-errorlogs
# meson test does not work with the custom ninja executable
run: ninja test -C builddir/ --verbose
- name: install project
run: meson install -C builddir/
- name: install pip requirements
run: pip install -r requirements.txt
- name: test (pytest)
run: pytest -v
- name: 'Upload error log'
uses: actions/upload-artifact@v4
if: failure()
with:
name: windows_Meson_testlog
path: builddir/meson-logs/meson-log.txt
retention-days: 5