1
1
# This workflow builds and tests the binary for various configurations.
2
2
name : Build and test
3
3
4
- # This workflow can only be triggered by other workflows.
4
+ # This workflow can only be triggered by other workflows. Note that the
5
+ # workflow_call event does not support the 'choice' input type, see
6
+ # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onworkflow_callinputsinput_idtype,
7
+ # so we use 'string' instead.
5
8
on :
6
9
workflow_call :
7
10
inputs :
29
32
type : boolean
30
33
default : false
31
34
os :
32
- description : ' The operating system to use for the build (linux, macos, or windows).'
35
+ description : ' The operating system to use for the build (" linux", " macos", " windows" ).'
33
36
required : true
34
37
type : string
35
- strategy_matrix_all :
36
- description : ' Generate a strategy matrix containing all configurations.'
38
+ strategy_matrix :
39
+ # TODO: Support additional strategies, e.g. "ubuntu" for generating all Ubuntu configurations.
40
+ description : ' The strategy matrix to use for generating the configurations ("minimal", "all").'
37
41
required : false
38
- type : boolean
39
- default : false
42
+ type : string
43
+ default : ' minimal '
40
44
secrets :
41
45
codecov_token :
42
46
description : ' The Codecov token to use for uploading coverage reports.'
70
74
- name : Generate strategy matrix
71
75
working-directory : .github/scripts/strategy-matrix
72
76
id : generate
73
- run : python generate.py ${{ inputs.strategy_matrix_all && '--all' || '' }} --config=${{ inputs.os }}.json >> "${GITHUB_OUTPUT}"
77
+ run : python generate.py ${{ inputs.strategy_matrix == 'all' && '--all' || '' }} --config=${{ inputs.os }}.json >> "${GITHUB_OUTPUT}"
74
78
outputs :
75
79
matrix : ${{ steps.generate.outputs.matrix }}
76
80
@@ -101,9 +105,11 @@ jobs:
101
105
uses : actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
102
106
with :
103
107
python-version : 3.13
104
- - name : Install Conan (Windows)
108
+ - name : Install build tools (Windows)
105
109
if : ${{ inputs.os == 'windows' }}
106
- run : pip install wheel conan
110
+ run : |
111
+ echo 'Installing build tools.'
112
+ pip install wheel conan
107
113
- name : Check configuration (Windows)
108
114
if : ${{ inputs.os == 'windows' }}
109
115
run : |
@@ -115,6 +121,11 @@ jobs:
115
121
116
122
echo 'Checking Conan version.'
117
123
conan --version
124
+ - name : Install build tools (MacOS)
125
+ if : ${{ inputs.os == 'macos' }}
126
+ run : |
127
+ echo 'Installing build tools.'
128
+ brew install cmake conan ninja coreutils
118
129
- name : Check configuration (Linux and MacOS)
119
130
if : ${{ inputs.os == 'linux' || inputs.os == 'macos' }}
120
131
run : |
@@ -135,6 +146,9 @@ jobs:
135
146
136
147
echo 'Checking Ninja version.'
137
148
ninja --version
149
+
150
+ echo 'Checking nproc version.'
151
+ nproc --version
138
152
- name : Set up Conan home directory (MacOS)
139
153
if : ${{ inputs.os == 'macos' }}
140
154
run : |
@@ -184,6 +198,7 @@ jobs:
184
198
uses : ./.github/actions/build-test
185
199
with :
186
200
build_dir : ${{ inputs.build_dir }}
201
+ build_only : ${{ matrix.build_only }}
187
202
build_type : ${{ matrix.build_type }}
188
203
cmake_args : ${{ matrix.cmake_args }}
189
204
cmake_target : ${{ matrix.cmake_target }}
0 commit comments