77 runs-on : ${{ matrix.os }}
88 strategy :
99 matrix :
10- os : [ubuntu-22.04, ubuntu-latest, macos-13, macos-latest, windows-latest]
11- version : [13] # GCC version
10+ os : [ubuntu-latest, macos-latest, windows-latest]
1211 fail-fast : false
1312 env :
14- GCC_V : ${{ matrix.version }}
15- CONDA_ENV : zerod
1613 PYTHONPATH : ${{ github.workspace }}
1714 steps :
1815 - uses : actions/checkout@v4
19- - uses : conda-incubator /setup-miniconda@v3
16+ - uses : actions /setup-python@v5
2017 with :
21- auto-update-conda : true
22- activate-environment : ${{env.CONDA_ENV}}
2318 python-version : " 3.11.4"
24- - name : Install ubuntu dependencies
25- if : startsWith(matrix.os, 'ubuntu')
26- run : sudo apt update && sudo apt install build-essential cmake lcov
2719
28- - name : Install dependencies to get correct version numbers (Ubuntu)
20+ - name : Install ubuntu dependencies
2921 if : startsWith(matrix.os, 'ubuntu')
30- run : conda install -c conda-forge libstdcxx-ng=${GCC_V} gcc=${GCC_V}
31-
32- - name : Install dependencies to get correct version numbers (MacOS)
33- if : startsWith(matrix.os, 'macos')
34- run : |
35- brew install gcc@${GCC_V}
36- ln -s /usr/local/bin/gcc-${GCC_V} /usr/local/bin/gcc
37-
38- - name : Install dependencies for windows
39- if : startsWith(matrix.os, 'windows')
40- shell : pwsh
41- run : |
42- choco install mingw --no-progress
43- conda install -y -c conda-forge cmake graphviz python-graphviz pydot
44- pip install --upgrade cmake-setuptools
22+ run : sudo apt update && sudo apt install build-essential cmake lcov graphviz
4523
46- - name : Install POISX -like svZeroDSolver
24+ - name : Install POSIX -like
4725 if : ${{!startsWith(matrix.os, 'windows')}}
48- run : conda run pip install -e ".[dev]"
49-
50- - name : Install Windows svZeroDSolver
51- if : startsWith(matrix.os, 'windows')
52- shell : pwsh
53- run : |
54- $Env:CMAKE_GENERATOR = 'MinGW Makefiles'
55- Write-Host "→ Using CMAKE_GENERATOR = $Env:CMAKE_GENERATOR"
56- pip install --no-build-isolation -v .[dev]
57- pip show pysvzerod
58-
59- - name : Install Networkx
60- run : |
61- conda run pip install networkx
26+ run : python -m pip install -e ".[dev]"
6227
6328 - name : Test the build
29+ if : ${{!startsWith(matrix.os, 'windows')}}
6430 run : |
6531 cd tests
66- conda run pytest -v --durations=0 --ignore=test_dirgraph.py
32+ python -m pytest -v --durations=0 --ignore=test_dirgraph.py
6733
68- - name : Build using CMake for POISX -like Systems
34+ - name : Build using CMake for POSIX -like Systems
6935 if : ${{!startsWith(matrix.os, 'windows')}}
7036 run : |
7137 mkdir Release
7238 cd Release
7339 cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_DISTRIBUTION=ON ..
7440 make -j2
7541
76- - name : Build using CMake for Windows Systems
77- if : startsWith(matrix.os, 'windows')
78- shell : pwsh
79- run : |
80- mkdir Release
81- cd Release
82- cmake -G "MinGW Makefiles" `
83- -DCMAKE_BUILD_TYPE=Release `
84- -DENABLE_DISTRIBUTION=ON `
85- ..
86- cmake --build . --parallel 2
87-
88- - name : Test interface POISX-like Systems
42+ - name : Test interface POSIX-like Systems
8943 if : ${{!startsWith(matrix.os, 'windows')}}
9044 run : |
9145 cd tests/test_interface
@@ -98,67 +52,73 @@ jobs:
9852 cd ../test_02
9953 ./svZeroD_interface_test02 ../../../../Release ../../test_02/svzerod_tuned.json
10054
101- - name : Test interface Windows Systems
102- if : startsWith(matrix.os, 'windows')
103- shell : pwsh
104- run : |
105- cd tests/test_interface
106- mkdir build_tests
107- cd build_tests
108- cmake -G "MinGW Makefiles" ..
109- cmake --build . --parallel 2
110- cd test_01
111- ./svZeroD_interface_test01.exe `
112- ../../../../Release `
113- ../../test_01/svzerod_3Dcoupling.json
114-
115- cd ../test_02
116- ./svZeroD_interface_test02 `
117- ../../../../Release `
118- ../../test_02/svzerod_tuned.json
119-
12055 - name : Generate code coverage
121- if : startsWith(matrix.os, 'ubuntu-22.04 ')
56+ if : startsWith(matrix.os, 'ubuntu-latest ')
12257 run : |
12358 cd Release
12459 cmake -DENABLE_COVERAGE=ON ..
12560 make -j2
12661 cd ../tests
127- conda run pytest -v --durations=0 --coverage --ignore=test_dirgraph.py
62+ python -m pytest -v --durations=0 --coverage --ignore=test_dirgraph.py
12863 cd ../Release
12964 make coverage
13065
13166 - name : Save coverage report
132- if : startsWith(matrix.os, 'ubuntu-22.04 ')
67+ if : startsWith(matrix.os, 'ubuntu-latest ')
13368 uses : actions/upload-artifact@v4
13469 with :
13570 name : coverage_report
13671 path : Release/coverage
13772
13873 - name : Upload coverage reports to Codecov
139- if : startsWith(matrix.os, 'ubuntu-22.04 ')
74+ if : startsWith(matrix.os, 'ubuntu-latest ')
14075 uses : codecov/codecov-action@v4
14176 env :
14277 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
14378
144- - name : Build installer POISX -like Systems
79+ - name : Build installer POSIX -like Systems
14580 if : ${{!startsWith(matrix.os, 'windows')}}
14681 run : |
14782 cd Release
14883 cpack
14984 cp distribution/svZeroDSolver_* ..
15085
151- - name : Install NSIS
86+ - name : Setup MSVC dev cmd
15287 if : startsWith(matrix.os, 'windows')
153- run : choco install nsis -y
88+ uses : ilammy/msvc-dev-cmd@v1
15489
155- - name : Build installer Windows Systems
90+ - name : Install and test Windows
15691 if : startsWith(matrix.os, 'windows')
92+ continue-on-error : true
15793 shell : pwsh
15894 run : |
159- # NSIS will be at C:\Program Files (x86)\NSIS\Bin
95+ python -m pip install --upgrade cmake cmake-setuptools numpy ninja pytest pandas graphviz networkx pydot
96+
97+ # keep MinGW/Strawberry off PATH (so Eigen won't try Fortran)
98+ $pattern = '^(C:\\mingw64\\bin|C:\\tools\\mingw64\\bin|C:\\Strawberry\\c\\bin|C:\\Strawberry\\perl\\site\\bin|C:\\Strawberry\\perl\\bin)$'
99+
100+ # one build dir for everything: executables + Python module
101+ $build = Join-Path $env:GITHUB_WORKSPACE 'Release'
102+ cmake -S . -B $build -G Ninja `
103+ -DCMAKE_BUILD_TYPE=Release `
104+ -DEIGEN_BUILD_BLAS=OFF `
105+ -DEIGEN_BUILD_DOC=OFF -DEIGEN_TEST_FORTRAN=OFF -DEIGEN_TEST_CXX11=OFF -DEIGEN_TEST_NOQT=ON `
106+ -DCMAKE_Fortran_COMPILER:FILEPATH="" `
107+ -DENABLE_DISTRIBUTION=ON
108+ cmake --build $build --parallel 2
109+
110+ # make the Python extension importable
111+ $pydDir = Join-Path $build 'python'
112+ $env:PYTHONPATH = "$pydDir;$env:PYTHONPATH"
113+
114+ # run integration tests
115+ cd (Join-Path $env:GITHUB_WORKSPACE 'tests')
116+ python -m pytest -v --durations=0 --ignore=test_dirgraph.py
117+
118+ # build installer
119+ choco install nsis -y
160120 echo "C:\Program Files (x86)\NSIS\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
161- cd Release
121+ cd $build
162122 cpack -C Release
163123 Copy-Item distribution\svZeroDSolver_* -Destination ..\
164124
0 commit comments