Skip to content

Valve status output #858

Valve status output

Valve status output #858

Workflow file for this run

# This workflow builds and tests svZeroDSolver. It is built and tested on
# different versions of ubuntu and macOS.
name: Build and test
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: false
env:
PYTHONPATH: ${{ github.workspace }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11.4"
- name: Install ubuntu dependencies
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install build-essential cmake lcov graphviz
- name: Install POSIX-like
if: ${{!startsWith(matrix.os, 'windows')}}
run: python -m pip install -e ".[dev]"
- name: Test the build
if: ${{!startsWith(matrix.os, 'windows')}}
run: |
cd tests
python -m pytest -v --durations=0 --ignore=test_dirgraph.py
- name: Build using CMake for POSIX-like Systems
if: ${{!startsWith(matrix.os, 'windows')}}
run: |
mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_DISTRIBUTION=ON ..
make -j2
- name: Test interface POSIX-like Systems
if: ${{!startsWith(matrix.os, 'windows')}}
run: |
cd tests/test_interface
mkdir build_tests
cd build_tests
cmake ../
make -j2
cd test_01
./svZeroD_interface_test01 ../../../../Release ../../test_01/svzerod_3Dcoupling.json
cd ../test_02
./svZeroD_interface_test02 ../../../../Release ../../test_02/svzerod_tuned.json
- name: Generate code coverage
if: startsWith(matrix.os, 'ubuntu-latest')
run: |
cd Release
cmake -DENABLE_COVERAGE=ON ..
make -j2
cd ../tests
python -m pytest -v --durations=0 --coverage --ignore=test_dirgraph.py
cd ../Release
make coverage
- name: Save coverage report
if: startsWith(matrix.os, 'ubuntu-latest')
uses: actions/upload-artifact@v4
with:
name: coverage_report
path: Release/coverage
- name: Upload coverage reports to Codecov
if: startsWith(matrix.os, 'ubuntu-latest')
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build installer POSIX-like Systems
if: ${{!startsWith(matrix.os, 'windows')}}
run: |
cd Release
cpack
cp distribution/svZeroDSolver_* ..
- name: Setup MSVC dev cmd
if: startsWith(matrix.os, 'windows')
uses: ilammy/msvc-dev-cmd@v1
- name: Install and test Windows
if: startsWith(matrix.os, 'windows')
continue-on-error: true
shell: pwsh
run: |
python -m pip install --upgrade cmake cmake-setuptools numpy ninja pytest pandas graphviz networkx pydot
# keep MinGW/Strawberry off PATH (so Eigen won't try Fortran)
$pattern = '^(C:\\mingw64\\bin|C:\\tools\\mingw64\\bin|C:\\Strawberry\\c\\bin|C:\\Strawberry\\perl\\site\\bin|C:\\Strawberry\\perl\\bin)$'
# one build dir for everything: executables + Python module
$build = Join-Path $env:GITHUB_WORKSPACE 'Release'
cmake -S . -B $build -G Ninja `
-DCMAKE_BUILD_TYPE=Release `
-DEIGEN_BUILD_BLAS=OFF `
-DEIGEN_BUILD_DOC=OFF -DEIGEN_TEST_FORTRAN=OFF -DEIGEN_TEST_CXX11=OFF -DEIGEN_TEST_NOQT=ON `
-DCMAKE_Fortran_COMPILER:FILEPATH="" `
-DENABLE_DISTRIBUTION=ON
cmake --build $build --parallel 2
# make the Python extension importable
$pydDir = Join-Path $build 'python'
$env:PYTHONPATH = "$pydDir;$env:PYTHONPATH"
# run integration tests
cd (Join-Path $env:GITHUB_WORKSPACE 'tests')
python -m pytest -v --durations=0 --ignore=test_dirgraph.py
# build installer
choco install nsis -y
echo "C:\Program Files (x86)\NSIS\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
cd $build
cpack -C Release
Copy-Item distribution\svZeroDSolver_* -Destination ..\
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }} installer
path: svZeroDSolver_*
if-no-files-found: error