@@ -23,15 +23,24 @@ jobs:
2323
2424 build-cpp-test-linux :
2525 if : (github.event_name == 'push') || (github.event_name == 'workflow_dispatch') || (!startsWith(github.head_ref, 'release'))
26- runs-on : ubuntu-latest
27- container : ghcr.io/alliander-opensource/power-grid-model-build-env:latest
26+ runs-on : ubuntu-22.04
2827 strategy :
2928 matrix :
3029 build-option : [ Debug, Release ]
30+ cpp-compiler : [g++-11, clang++-14]
31+ env :
32+ CMAKE_PREFIX_PATH : /home/linuxbrew/.linuxbrew
33+ CXX : ${{ matrix.cpp-compiler }}
3134
3235 steps :
3336 - uses : actions/checkout@v3
34-
37+ - name : Install packages
38+ run : |
39+ sudo apt-get update
40+ sudo apt-get install -y ninja-build
41+ - name : Install C++ dependencies
42+ run : |
43+ brew install boost eigen nlohmann-json doctest
3544 - name : Run build script
3645 run : ./build.sh ${{ matrix.build-option }}
3746
@@ -50,16 +59,14 @@ jobs:
5059 & "$env:CONDA\condabin\conda" init
5160
5261 - name : Install conda environment
53- # TODO removed pinned v2 of catch2, see https://github.com/alliander-opensource/power-grid-model/issues/73
5462 run : |
55- conda create --yes -p C:\conda_envs\cpp_pkgs -c conda-forge boost-cpp eigen nlohmann_json catch2==2.13.9
63+ conda create --yes -p C:\conda_envs\cpp_pkgs -c conda-forge boost-cpp eigen nlohmann_json doctest
5664
5765 - name : Build and test
5866 run : |
5967 $vsPath = &(Join-Path ${env:ProgramFiles(x86)} '\Microsoft Visual Studio\Installer\vswhere.exe') -property installationpath
6068 Import-Module (Join-Path $vsPath 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll')
6169 Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -host_arch=x64'
62- $env:Path += ";C:\conda_envs\cpp_pkgs\Library\bin"
6370 mkdir cpp_build_${{ matrix.build-option }}
6471 cd cpp_build_${{ matrix.build-option }}
6572 # generate cmake cache
8895 - uses : actions/checkout@v3
8996
9097 - name : Install cpp dependencies
91- # TODO removed pinned v2 of catch2, see https://github.com/alliander-opensource/power-grid-model/issues/73
9298 run : |
93- brew install ninja boost eigen nlohmann-json
94- curl https://raw.githubusercontent.com/Homebrew/homebrew-core/5e5abb11bf49787d01164c4066119365262c21ed/Formula/catch2.rb > $(find $(brew --repository) -name catch2.rb) && brew reinstall catch2
99+ brew install ninja boost eigen nlohmann-json doctest
95100
96101 - name : Build and test
97102 run : |
@@ -106,24 +111,18 @@ jobs:
106111 os : ubuntu-latest
107112 cc : gcc
108113 cxx : g++
109- boost :
110- eigen :
111114 cibw_build : " cp*-manylinux_x86_64 cp*-manylinux_aarch64"
112115 archs : " x86_64 aarch64"
113116 - platform : macos
114117 os : macos-latest
115118 cc : clang
116119 cxx : clang++
117- boost : /usr/local/include
118- eigen : /usr/local/include/eigen3
119120 cibw_build : cp*-macosx_*
120121 archs : " x86_64 arm64"
121122 - platform : windows
122123 os : windows-latest
123124 cc :
124125 cxx :
125- boost : C:\conda_envs\cpp_pkgs\Library\include
126- eigen : C:\conda_envs\cpp_pkgs\Library\include\eigen3
127126 cibw_build : cp*-win_amd64
128127 archs : AMD64
129128
@@ -133,26 +132,18 @@ jobs:
133132 env :
134133 CC : ${{ matrix.cc }}
135134 CXX : ${{ matrix.cxx }}
136- BOOST_INCLUDE : ${{ matrix.boost }}
137- EIGEN_INCLUDE : ${{ matrix.eigen }}
138135 CIBW_BUILD_VERBOSITY : 1
139136 CIBW_BUILD_FRONTEND : " build"
140137 CIBW_BUILD : ${{ matrix.cibw_build }}
141138 CIBW_ARCHS : ${{ matrix.archs }}
142- CIBW_TEST_REQUIRES : pytest pytest-cov
139+ CIBW_TEST_EXTRAS : " dev "
143140 CIBW_TEST_COMMAND : pytest {package}/tests
144141 # Skip trying to test arm64 builds on Intel Macs
145142 CIBW_TEST_SKIP : " *-macosx_arm64 *-macosx_universal2:arm64"
146- CIBW_MANYLINUX_X86_64_IMAGE : ghcr.io/alliander-opensource/power-grid-model-build-env
147- CIBW_MANYLINUX_AARCH64_IMAGE : ghcr.io/alliander-opensource/power-grid-model-build-env-arm64
148- CIBW_ENVIRONMENT_PASS_LINUX : GITHUB_SHA GITHUB_REF GITHUB_RUN_NUMBER
149- CIBW_BEFORE_ALL_MACOS : >
150- which clang++ &&
151- clang++ --version &&
152- brew install boost eigen
143+ CIBW_ENVIRONMENT_PASS_LINUX : GITHUB_SHA GITHUB_REF GITHUB_RUN_NUMBER CC CXX
153144 MACOSX_DEPLOYMENT_TARGET : 10.15
154- CIBW_BEFORE_ALL_WINDOWS : >
155- conda create --yes -p C:\conda_envs\cpp_pkgs -c conda-forge boost-cpp eigen
145+ CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
146+ CIBW_MANYLINUX_AARCH64_IMAGE : manylinux2014
156147
157148 steps :
158149 - uses : actions/checkout@v3
@@ -161,11 +152,6 @@ jobs:
161152 if : matrix.platform == 'linux'
162153 uses : docker/setup-qemu-action@v2
163154
164- - name : Activate conda for windows
165- if : matrix.platform == 'windows'
166- run : |
167- & "$env:CONDA\condabin\conda" init
168-
169155 - name : Build wheels
170156171157
0 commit comments