3131 type : string
3232 build-type :
3333 type : string
34+ msystem :
35+ type : string
3436 python :
3537 type : string
3638 pybind11 :
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
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 }} \
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
0 commit comments