@@ -22,33 +22,26 @@ jobs:
2222 build :
2323 # Skip CI if PR is a draft
2424 if : github.event.pull_request.draft == false
25- name : build (${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}})
25+ name : build (${{matrix.os}}-${{matrix.container}}-${{matrix. cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}})
2626 # The CMake configure and build commands are platform agnostic and should work equally
2727 # well on Windows or Mac. You can convert this to a matrix build if you need
2828 # cross-platform coverage.
2929 # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
3030 runs-on : ${{matrix.os}}
31+ container : ${{matrix.container}}
3132 env :
3233 CXX : ${{ matrix.cxx }}
3334 strategy :
3435 fail-fast : false
3536 matrix :
36- os :
37- - ubuntu-22.04
38- - macos-14
39- cxx :
40- - g++
41- - clang++
42- mpi :
43- - " ON"
44- - " OFF"
45- omp :
46- - " ON"
47- - " OFF"
48- exclude :
49- - { os: ubuntu-22.04, cxx: clang++ }
50- - { os: macos-14, cxx: g++ }
51- - { os: macos-14, mpi: "ON"}
37+ include :
38+ - { os: ubuntu-22.04, cxx: g++, mpi: "ON", omp: "ON" }
39+ - { os: ubuntu-22.04, cxx: g++, mpi: "ON", omp: "OFF" }
40+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "ON" }
41+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "OFF"}
42+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "ON", distribution: "fedora", container: "fedora:39" }
43+ - { os: macos-14, cxx: clang++, mpi: "ON", omp: "ON" }
44+ - { os: macos-14, cxx: clang++, mpi: "OFF", omp: "OFF" }
5245 steps :
5346 - uses : actions/checkout@v4
5447
6760 uses : actions/cache@v4
6861 with :
6962 path : ${{runner.workspace}}/.ccache
70- key : ${{matrix.os}}-${{matrix.cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }}
63+ key : ${{matrix.os}}-${{matrix.container}}-${{matrix. cxx}}-${{matrix.mpi}}-${{matrix.omp}}-${{ steps.ccache_cache_timestamp.outputs.date_and_time }}
7164 restore-keys : |
65+ ${{ matrix.os }}-${{matrix.container}}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
7266 ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
7367 ${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}
7468 ${{ matrix.os }}-${{ matrix.cxx }}
@@ -78,11 +72,18 @@ jobs:
7872# run: ccache --clear
7973
8074 - name : Install Dependencies on Ubunutu
81- if : ${{ contains(matrix.os, 'ubuntu') }}
75+ if : contains(matrix.os, 'ubuntu') && !contains(matrix.container, 'fedora')
8276 run : |
8377 sudo apt update
8478 sudo apt install openmpi-bin libopenmpi-dev libyaml-cpp-dev libeigen3-dev libtiff-dev ccache
8579
80+ - name : Install Dependencies on Fedora
81+ if : ${{ contains(matrix.container, 'fedora') }}
82+ run : |
83+ sudo dnf -y update
84+ sudo dnf -y install cmake gcc gcc-c++ wget
85+ sudo dnf -y install openmpi openmpi-devel yaml-cpp ccache eigen3-devel libtiff-devel git
86+
8687 - name : Install Dependencies on MacOS
8788 if : ${{ contains(matrix.os, 'macos') }}
8889 run : |
@@ -123,63 +124,63 @@ jobs:
123124 - name : Build sopt
124125 run : |
125126 export CMAKE_PREFIX_PATH=${{github.workspace}}/local:$CMAKE_PREFIX_PATH
126- mkdir -p ${{github.workspace}}/ sopt/build
127- cd ${{github.workspace}}/ sopt/build
127+ mkdir -p sopt/build
128+ cd sopt/build
128129 cmake .. --fresh -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local -Donnxrt=ON -Ddompi=${{matrix.mpi}} -Dopenmp=${{matrix.omp}} -Dtests=OFF -Dexamples=OFF
129130 make -j$(nproc --ignore 1) install
130131
131132 - name : Pack dependencies
132133 run : |
133- cd ${{github.workspace}}
134- tar cfv dependencies.tar local
134+ tar cfv dependencies.tar ${{github.workspace}}/local
135135
136136 - uses : actions/upload-artifact@v4
137137 with :
138- name : dependencies-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
138+ name : dependencies-${{ matrix.os }}-${{ matrix.distribution }}-${{ matrix. cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
139139 path : ${{github.workspace}}/dependencies.tar
140140 retention-days : 5
141141
142142 test :
143143 needs :
144144 build
145- name : test (${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}})
145+ name : test (${{matrix.os}}-${{ matrix.distribution }}-${{ matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}})
146146 runs-on : ${{matrix.os}}
147+ container : ${{matrix.container}}
147148 env :
148149 CXX : ${{ matrix.cxx }}
149150 strategy :
150151 fail-fast : false
151152 matrix :
152- os :
153- - ubuntu-22.04
154- - macos-14
155- cxx :
156- - g++
157- - clang++
158- mpi :
159- - " ON"
160- - " OFF"
161- omp :
162- - " ON"
163- - " OFF"
164- exclude :
165- - { os: ubuntu-22.04, cxx: clang++ }
166- - { os: macos-14, cxx: g++ }
167- - { os: macos-14, mpi: "ON"}
153+ include :
154+ - { os: ubuntu-22.04, cxx: g++, mpi: "ON", omp: "ON" }
155+ - { os: ubuntu-22.04, cxx: g++, mpi: "ON", omp: "OFF" }
156+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "ON" }
157+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "OFF" }
158+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "ON", distribution: "fedora", container: "fedora:39" }
159+ - { os: macos-14, cxx: clang++, mpi: "ON", omp: "ON" }
160+ - { os: macos-14, cxx: clang++, mpi: "OFF", omp: "OFF" }
161+
168162 steps :
169163 - uses : actions/checkout@v4
170164
171165 - uses : actions/download-artifact@v4
172166 with :
173- name : dependencies-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
167+ name : dependencies-${{ matrix.os }}-${{matrix.container}}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
174168
175169 - name : Unpack dependencies
176170 run : tar xfv dependencies.tar
177171
178172 - name : Install Dependencies on Ubunutu
179- if : ${{ contains(matrix.os, 'ubuntu') }}
173+ if : contains(matrix.os, 'ubuntu') && !contains(matrix.container, 'fedora')
180174 run : |
181175 sudo apt update
182- sudo apt install openmpi-bin libopenmpi-dev ccache graphviz libeigen3-dev libtiff-dev libcfitsio-dev libboost-all-dev libyaml-cpp-dev
176+ sudo apt install openmpi-bin libopenmpi-dev ccache libeigen3-dev libtiff-dev libcfitsio-dev libboost-all-dev libyaml-cpp-dev
177+
178+ - name : Install Dependencies on Fedora
179+ if : ${{ contains(matrix.container, 'fedora') }}
180+ run : |
181+ sudo dnf -y update
182+ sudo dnf -y install cmake gcc gcc-c++
183+ sudo dnf -y install openmpi openmpi-devel yaml-cpp ccache eigen3-devel libtiff-devel cfitsio-devel boost-devel
183184
184185 - name : Install Dependencies on MacOS
185186 if : ${{ contains(matrix.os, 'macos') }}
@@ -208,27 +209,21 @@ jobs:
208209 doc :
209210 needs :
210211 build
211- name : doc (${{matrix.os}}-${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}})
212+ name : doc (${{matrix.os}}-- ${{matrix.cxx}}-mpi:${{matrix.mpi}}-openmp:${{matrix.omp}})
212213 runs-on : ${{matrix.os}}
213214 env :
214215 CXX : ${{ matrix.cxx }}
215216 strategy :
216217 fail-fast : false
217218 matrix :
218- os :
219- - ubuntu-22.04
220- cxx :
221- - g++
222- mpi :
223- - " OFF"
224- omp :
225- - " OFF"
219+ include :
220+ - { os: ubuntu-22.04, cxx: g++, mpi: "OFF", omp: "OFF" }
226221 steps :
227222 - uses : actions/checkout@v4
228223
229224 - uses : actions/download-artifact@v4
230225 with :
231- name : dependencies-${{ matrix.os }}-${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
226+ name : dependencies-${{ matrix.os }}-- ${{ matrix.cxx }}-${{ matrix.mpi }}-${{ matrix.omp }}
232227
233228 - name : Unpack dependencies
234229 run : tar xfv dependencies.tar
0 commit comments