Skip to content

Commit 6aad7fd

Browse files
authored
Add MSYS2 jobs to CI (AcademySoftwareFoundation#474)
Similar to AcademySoftwareFoundation/openexr#2014 Signed-off-by: Cary Phillips <cary@ilm.com>
1 parent f65b01c commit 6aad7fd

6 files changed

Lines changed: 242 additions & 18 deletions

File tree

.github/workflows/ci_steps.yml

Lines changed: 52 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ on:
3131
type: string
3232
build-type:
3333
type: string
34+
msystem:
35+
type: string
3436
python:
3537
type: string
3638
pybind11:
@@ -62,6 +64,15 @@ jobs:
6264
- name: Checkout
6365
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
6466

67+
- name: Install MSYS2 ${{ inputs.msystem }}
68+
if: inputs.msystem != ''
69+
uses: msys2/setup-msys2@61f9e5e925871ba6c9e3e8da24ede83ea27fa91f # v2.27.0
70+
with:
71+
msystem: ${{ inputs.msystem }}
72+
update: true
73+
install: git
74+
pacboy: cc:p cmake:p
75+
6576
- name: Create build directories
6677
run: mkdir _install _build _examples
6778
shell: bash
@@ -71,7 +82,7 @@ jobs:
7182
# Construct the cmake command as a variable, so the
7283
# Configure step below can execute it, but also so we can store
7384
# in in the install_manifest as a debugging reference
74-
CMAKE_COMMAND="cmake -B . -S .. \
85+
CMAKE_ARGS="-B . -S .. \
7586
-DCMAKE_INSTALL_PREFIX=../_install \
7687
-DCMAKE_BUILD_TYPE=${{ inputs.build-type }} \
7788
-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }} \
@@ -82,9 +93,9 @@ jobs:
8293
-DPYBIND11=${{ inputs.pybind11 }} \
8394
-DCMAKE_VERBOSE_MAKEFILE=ON"
8495
if [ -n "${{ inputs.namespace }}" ]; then
85-
CMAKE_COMMAND="$CMAKE_COMMAND -DIMATH_NAMESPACE=${{ inputs.namespace }}"
96+
CMAKE_ARGS="$CMAKE_ARGS -DIMATH_NAMESPACE=${{ inputs.namespace }}"
8697
fi
87-
echo "CMAKE_COMMAND=$CMAKE_COMMAND" >> $GITHUB_ENV
98+
echo "CMAKE_ARGS=$CMAKE_ARGS" >> $GITHUB_ENV
8899
89100
# Remove the os version from the manifest name, so it only
90101
# contains "ubuntu", "macos", or "windows", so the name is,
@@ -93,17 +104,28 @@ jobs:
93104
working-directory: _build
94105
shell: bash
95106

96-
- name: Configure
107+
- name: Configure, Build, Test
108+
if: inputs.msystem == ''
97109
run: |
98-
$CMAKE_COMMAND
110+
cmake $CMAKE_ARGS
111+
cmake --build . --target install --config ${{ inputs.build-type }}
112+
if [ "${{ inputs.BUILD_TESTING }}" == "ON" ]; then
113+
ctest -T Test -C ${{ inputs.build-type }} --timeout 7200 --output-on-failure -VV
114+
fi
99115
working-directory: _build
100116
shell: bash
101117

102-
- name: Build
118+
- name: Configure, Build, Test (msys2) # requires msys2 shell
119+
if: inputs.msystem != ''
103120
run: |
121+
cmake --version
122+
cmake $CMAKE_ARGS
104123
cmake --build . --target install --config ${{ inputs.build-type }}
124+
if [ "${{ inputs.BUILD_TESTING }}" == "ON" ]; then
125+
ctest -T Test -C ${{ inputs.build-type }} --timeout 7200 --output-on-failure -VV
126+
fi
105127
working-directory: _build
106-
shell: bash
128+
shell: msys2 {0}
107129

108130
- name: Find python version
109131
run: |
@@ -117,14 +139,15 @@ jobs:
117139
# and remove the path prefix, so the manifest contains only
118140
# the local filenames.
119141
run: |
120-
echo "# $CMAKE_COMMAND" > "_build/$INSTALL_MANIFEST"
142+
echo "# cmake $CMAKE_ARGS" > "_build/$INSTALL_MANIFEST"
121143
sort _build/install_manifest.txt | sed -e "s:^.*/_install/::" >> "_build/$INSTALL_MANIFEST"
122144
shell: bash
123145

124146
- name: Upload install_manifest.txt
125147
# Upload the manifest to make it possible to download for inspection and debugging
126148
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
127149
with:
150+
128151
name: ${{ env.INSTALL_MANIFEST }}
129152
path: _build/${{ env.INSTALL_MANIFEST }}
130153

@@ -136,7 +159,7 @@ jobs:
136159
shell: bash
137160

138161
- name: Test standalone
139-
continue-on-error: true
162+
if: inputs.msystem == ''
140163
run: |
141164
# Make sure we can build the tests when configured as a
142165
# standalone application linking against the just-installed
@@ -155,11 +178,11 @@ jobs:
155178
./bin/ImathTest
156179
fi
157180
shell: bash
158-
working-directory: _examples
181+
working-directory: _examples
159182

160183
- name: Examples
161184
# The example code use the Imath:: namespace explicitly, they won't work with a custom namespace, so skip the test in that case.
162-
if: ${{ inputs.namespace == '' }}
185+
if: inputs.namespace == '' && inputs.msystem == ''
163186
run: |
164187
# Confirm the examples compile and execute
165188
rm -rf bin CMakeCache.txt CMakeFiles cmake_install.cmake Makefile
@@ -175,9 +198,25 @@ jobs:
175198
./bin/imath-intro
176199
./bin/imath-examples
177200
fi
178-
179201
shell: bash
180-
working-directory: _examples
202+
working-directory: _examples
203+
204+
- name: Examples (msys2)
205+
# The example code use the Imath:: namespace explicitly, they won't work with a custom namespace, so skip the test in that case.
206+
if: inputs.namespace == '' && inputs.msystem != ''
207+
run: |
208+
# Confirm the examples compile and execute
209+
rm -rf bin CMakeCache.txt CMakeFiles cmake_install.cmake Makefile
210+
cmake ../website/examples \
211+
-DCMAKE_PREFIX_PATH=../../_install \
212+
-DCMAKE_BUILD_TYPE=${{ inputs.build-type }} \
213+
-DCMAKE_CXX_STANDARD=${{ inputs.cxx-standard }}
214+
cmake --build . --config ${{ inputs.build-type }}
215+
export PATH="${{ github.workspace }}/_install/bin:$PATH"
216+
./bin/imath-intro.exe
217+
./bin/imath-examples.exe
218+
shell: msys2 {0}
219+
working-directory: _examples
181220

182221
- name: Test Python
183222
if: ${{ inputs.python == 'ON' }}
@@ -196,8 +235,3 @@ jobs:
196235
shell: bash
197236
working-directory: _build
198237

199-
- name: Test
200-
run: |
201-
ctest -T Test -C ${{ inputs.build-type }} --timeout 7200 --output-on-failure -VV
202-
working-directory: _build
203-
shell: bash

.github/workflows/ci_workflow.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ jobs:
152152
BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS || 'ON' }}
153153
IMATH_INSTALL_PKG_CONFIG: ${{ matrix.IMATH_INSTALL_PKG_CONFIG || 'ON' }}
154154
BUILD_TESTING: ${{ matrix.BUILD_TESTING || 'ON' }}
155+
msystem: ${{ matrix.msystem }}
155156
validate_install: ${{ matrix.validate_install || 'ON' }}
156157
strategy:
157158
matrix:
@@ -176,3 +177,22 @@ jobs:
176177
label: vfx2022
177178
os: windows-2019
178179

180+
- build: 7
181+
label: msys2-mingw32
182+
msystem: MINGW32
183+
BUILD_TESTING: 'OFF'
184+
185+
- build: 8
186+
label: msys2-mingw32, static
187+
msystem: MINGW32
188+
BUILD_SHARED_LIBS: 'OFF'
189+
BUILD_TESTING: 'OFF'
190+
191+
- build: 9
192+
label: msys2-ucrt64
193+
msystem: UCRT64
194+
195+
- build: 10
196+
label: msys2-ucrt64, static
197+
msystem: UCRT64
198+
BUILD_SHARED_LIBS: 'OFF'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# cmake -B . -S .. -DCMAKE_INSTALL_PREFIX=../_install -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DIMATH_INSTALL_PKG_CONFIG=ON -DBUILD_TESTING=ON -DPYTHON=OFF -DPYBIND11=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
2+
include/Imath/ImathBox.h
3+
include/Imath/ImathBoxAlgo.h
4+
include/Imath/ImathColor.h
5+
include/Imath/ImathColorAlgo.h
6+
include/Imath/ImathConfig.h
7+
include/Imath/ImathEuler.h
8+
include/Imath/ImathExport.h
9+
include/Imath/ImathForward.h
10+
include/Imath/ImathFrame.h
11+
include/Imath/ImathFrustum.h
12+
include/Imath/ImathFrustumTest.h
13+
include/Imath/ImathFun.h
14+
include/Imath/ImathGL.h
15+
include/Imath/ImathGLU.h
16+
include/Imath/ImathInt64.h
17+
include/Imath/ImathInterval.h
18+
include/Imath/ImathLine.h
19+
include/Imath/ImathLineAlgo.h
20+
include/Imath/ImathMath.h
21+
include/Imath/ImathMatrix.h
22+
include/Imath/ImathMatrixAlgo.h
23+
include/Imath/ImathNamespace.h
24+
include/Imath/ImathPlane.h
25+
include/Imath/ImathPlatform.h
26+
include/Imath/ImathQuat.h
27+
include/Imath/ImathRandom.h
28+
include/Imath/ImathRoots.h
29+
include/Imath/ImathShear.h
30+
include/Imath/ImathSphere.h
31+
include/Imath/ImathTypeTraits.h
32+
include/Imath/ImathVec.h
33+
include/Imath/ImathVecAlgo.h
34+
include/Imath/half.h
35+
include/Imath/halfFunction.h
36+
include/Imath/halfLimits.h
37+
lib/cmake/Imath/ImathConfig.cmake
38+
lib/cmake/Imath/ImathConfigVersion.cmake
39+
lib/cmake/Imath/ImathTargets-release.cmake
40+
lib/cmake/Imath/ImathTargets.cmake
41+
lib/libImath-$MAJOR_$MINOR.a
42+
lib/pkgconfig/Imath.pc
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# cmake -B . -S .. -DCMAKE_INSTALL_PREFIX=../_install -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON -DIMATH_INSTALL_PKG_CONFIG=ON -DBUILD_TESTING=OFF -DPYTHON=OFF -DPYBIND11=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
2+
bin/libImath-$MAJOR_$MINOR.dll
3+
include/Imath/ImathBox.h
4+
include/Imath/ImathBoxAlgo.h
5+
include/Imath/ImathColor.h
6+
include/Imath/ImathColorAlgo.h
7+
include/Imath/ImathConfig.h
8+
include/Imath/ImathEuler.h
9+
include/Imath/ImathExport.h
10+
include/Imath/ImathForward.h
11+
include/Imath/ImathFrame.h
12+
include/Imath/ImathFrustum.h
13+
include/Imath/ImathFrustumTest.h
14+
include/Imath/ImathFun.h
15+
include/Imath/ImathGL.h
16+
include/Imath/ImathGLU.h
17+
include/Imath/ImathInt64.h
18+
include/Imath/ImathInterval.h
19+
include/Imath/ImathLine.h
20+
include/Imath/ImathLineAlgo.h
21+
include/Imath/ImathMath.h
22+
include/Imath/ImathMatrix.h
23+
include/Imath/ImathMatrixAlgo.h
24+
include/Imath/ImathNamespace.h
25+
include/Imath/ImathPlane.h
26+
include/Imath/ImathPlatform.h
27+
include/Imath/ImathQuat.h
28+
include/Imath/ImathRandom.h
29+
include/Imath/ImathRoots.h
30+
include/Imath/ImathShear.h
31+
include/Imath/ImathSphere.h
32+
include/Imath/ImathTypeTraits.h
33+
include/Imath/ImathVec.h
34+
include/Imath/ImathVecAlgo.h
35+
include/Imath/half.h
36+
include/Imath/halfFunction.h
37+
include/Imath/halfLimits.h
38+
lib/cmake/Imath/ImathConfig.cmake
39+
lib/cmake/Imath/ImathConfigVersion.cmake
40+
lib/cmake/Imath/ImathTargets-release.cmake
41+
lib/cmake/Imath/ImathTargets.cmake
42+
lib/libImath-$MAJOR_$MINOR.dll.a
43+
lib/pkgconfig/Imath.pc
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# cmake -B . -S .. -DCMAKE_INSTALL_PREFIX=../_install -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DIMATH_INSTALL_PKG_CONFIG=ON -DBUILD_TESTING=OFF -DPYTHON=OFF -DPYBIND11=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
2+
include/Imath/ImathBox.h
3+
include/Imath/ImathBoxAlgo.h
4+
include/Imath/ImathColor.h
5+
include/Imath/ImathColorAlgo.h
6+
include/Imath/ImathConfig.h
7+
include/Imath/ImathEuler.h
8+
include/Imath/ImathExport.h
9+
include/Imath/ImathForward.h
10+
include/Imath/ImathFrame.h
11+
include/Imath/ImathFrustum.h
12+
include/Imath/ImathFrustumTest.h
13+
include/Imath/ImathFun.h
14+
include/Imath/ImathGL.h
15+
include/Imath/ImathGLU.h
16+
include/Imath/ImathInt64.h
17+
include/Imath/ImathInterval.h
18+
include/Imath/ImathLine.h
19+
include/Imath/ImathLineAlgo.h
20+
include/Imath/ImathMath.h
21+
include/Imath/ImathMatrix.h
22+
include/Imath/ImathMatrixAlgo.h
23+
include/Imath/ImathNamespace.h
24+
include/Imath/ImathPlane.h
25+
include/Imath/ImathPlatform.h
26+
include/Imath/ImathQuat.h
27+
include/Imath/ImathRandom.h
28+
include/Imath/ImathRoots.h
29+
include/Imath/ImathShear.h
30+
include/Imath/ImathSphere.h
31+
include/Imath/ImathTypeTraits.h
32+
include/Imath/ImathVec.h
33+
include/Imath/ImathVecAlgo.h
34+
include/Imath/half.h
35+
include/Imath/halfFunction.h
36+
include/Imath/halfLimits.h
37+
lib/cmake/Imath/ImathConfig.cmake
38+
lib/cmake/Imath/ImathConfigVersion.cmake
39+
lib/cmake/Imath/ImathTargets-release.cmake
40+
lib/cmake/Imath/ImathTargets.cmake
41+
lib/libImath-$MAJOR_$MINOR.a
42+
lib/pkgconfig/Imath.pc
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# cmake -B . -S .. -DCMAKE_INSTALL_PREFIX=../_install -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON -DIMATH_INSTALL_PKG_CONFIG=ON -DBUILD_TESTING=ON -DPYTHON=OFF -DPYBIND11=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
2+
bin/libImath-$MAJOR_$MINOR.dll
3+
include/Imath/ImathBox.h
4+
include/Imath/ImathBoxAlgo.h
5+
include/Imath/ImathColor.h
6+
include/Imath/ImathColorAlgo.h
7+
include/Imath/ImathConfig.h
8+
include/Imath/ImathEuler.h
9+
include/Imath/ImathExport.h
10+
include/Imath/ImathForward.h
11+
include/Imath/ImathFrame.h
12+
include/Imath/ImathFrustum.h
13+
include/Imath/ImathFrustumTest.h
14+
include/Imath/ImathFun.h
15+
include/Imath/ImathGL.h
16+
include/Imath/ImathGLU.h
17+
include/Imath/ImathInt64.h
18+
include/Imath/ImathInterval.h
19+
include/Imath/ImathLine.h
20+
include/Imath/ImathLineAlgo.h
21+
include/Imath/ImathMath.h
22+
include/Imath/ImathMatrix.h
23+
include/Imath/ImathMatrixAlgo.h
24+
include/Imath/ImathNamespace.h
25+
include/Imath/ImathPlane.h
26+
include/Imath/ImathPlatform.h
27+
include/Imath/ImathQuat.h
28+
include/Imath/ImathRandom.h
29+
include/Imath/ImathRoots.h
30+
include/Imath/ImathShear.h
31+
include/Imath/ImathSphere.h
32+
include/Imath/ImathTypeTraits.h
33+
include/Imath/ImathVec.h
34+
include/Imath/ImathVecAlgo.h
35+
include/Imath/half.h
36+
include/Imath/halfFunction.h
37+
include/Imath/halfLimits.h
38+
lib/cmake/Imath/ImathConfig.cmake
39+
lib/cmake/Imath/ImathConfigVersion.cmake
40+
lib/cmake/Imath/ImathTargets-release.cmake
41+
lib/cmake/Imath/ImathTargets.cmake
42+
lib/libImath-$MAJOR_$MINOR.dll.a
43+
lib/pkgconfig/Imath.pc

0 commit comments

Comments
 (0)