Added debug message #1525
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DO NOT MODIFY THIS FILE, IT IS GENERATED. | |
# To make changes, modify '.git/../utils/test-install-base.yml' | |
# and run 'ygggha' | |
env: | |
BUILDDOCS: 0 | |
INSTALLC: 1 | |
INSTALLEXCEL: 1 | |
INSTALLFORTRAN: 1 | |
INSTALLIMAGES: 1 | |
INSTALLJULIA: 0 | |
INSTALLLPY: 0 | |
INSTALLMATLAB: 0 | |
INSTALLMPI: 1 | |
INSTALLOMP: 1 | |
INSTALLPYGMENTS: 1 | |
INSTALLPYTORCH: 1 | |
INSTALLR: 0 | |
INSTALLRMQ: 0 | |
INSTALLSBML: 0 | |
INSTALLSEQ: 0 | |
INSTALLTRIMESH: 1 | |
INSTALLZMQ: 1 | |
NUMPY: numpy | |
PYTHONVERSION_MAX: 3.12 | |
PYTHONVERSION_MIN: 3.7 | |
PYTHONVERSION_STD: 3.9 | |
TMPDIR: /tmp/ | |
USEVIRTUALENV: 0 | |
YGG_GHA_JOB_ID_SUFFIX: null | |
jobs: | |
build_sdist: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Build source distribution | |
needs: | |
- test_pip | |
- test_conda | |
- test_rmq_pip | |
- test_rmq_conda | |
- test_stripped | |
- docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: std | |
- name: Install build utilities | |
run: 'python -m pip install build | |
' | |
- name: Build sdist | |
run: 'python -m build --sdist | |
' | |
- name: Install sdist | |
run: 'python -m pip install dist/*.gz | |
python utils/setup_test_env.py deps pip | |
' | |
- name: Test sdist | |
run: 'ygginfo | |
pytest -m subset_rapidjson tests | |
' | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sdist | |
path: ./dist/* | |
build_wheels: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Build wheels on ${{ matrix.os }} | |
needs: | |
- test_pip | |
- test_conda | |
- test_rmq_pip | |
- test_rmq_conda | |
- test_stripped | |
- docs | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- if: runner.os == 'Linux' | |
name: (LINUX) Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: all | |
- if: ${{ matrix.windows_arch == 'x86' }} | |
name: setup rtools for 32-bit | |
run: 'echo "PLAT=i686" >> $env:GITHUB_ENV | |
echo "PATH=$env:RTOOLS40_HOME\mingw32\bin;$env:PATH" >> $env:GITHUB_ENV | |
gfortran --version | |
' | |
- env: | |
CIBW_ARCHS_LINUX: ${{ matrix.linux_arch }} | |
CIBW_ARCHS_MACOS: ${{ matrix.mac_arch }} | |
CIBW_ARCHS_WINDOWS: ${{ matrix.windows_arch }} | |
name: Build wheels | |
uses: pypa/[email protected] | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ./wheelhouse/*.whl | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-2019 | |
windows_arch: x86 | |
- linux_arch: aarch64 | |
os: ubuntu-20.04 | |
- linux_arch: ppc64le | |
os: ubuntu-20.04 | |
linux_arch: | |
- auto | |
mac_arch: | |
- x86_64 arm64 | |
os: | |
- ubuntu-20.04 | |
- macOS-11 | |
- windows-2019 | |
windows_arch: | |
- AMD64 | |
docker: | |
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) || github.event.schedule | |
== '0 10 1 * *' | |
name: Build and Publish Docker images | |
needs: | |
- test_pip | |
- test_conda | |
- test_rmq_pip | |
- test_rmq_conda | |
- test_stripped | |
- docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: std | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
- name: Build and push environment docker images for the new release | |
run: python utils/build_docker.py --push | |
- name: Build and push executable docker images for the new release | |
run: python utils/build_docker.py --push executable | |
docs: | |
env: | |
BUILDDOCS: 1 | |
name: Build the Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHONVERSION_STD }} | |
- name: Install dependencies | |
run: python utils/setup_test_env.py install pip | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Build the docs | |
run: 'cd docs | |
make autodoc | |
cd ../ | |
' | |
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Publish docs to Github pages | |
uses: JamesIves/[email protected] | |
with: | |
BRANCH: gh-pages | |
FOLDER: docs/build/html/ | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
params: | |
name: Prepare test parameters | |
outputs: | |
os-versions: ${{ steps.set-os-versions.outputs.versions }} | |
test-flags: ${{ steps.set-test-flags.outputs.testflags }} | |
runs-on: ubuntu-latest | |
steps: | |
- id: set-os-versions | |
run: echo "versions={\"ubuntu\":\"latest\", \"macos\":\"latest\", \"windows\":\"latest\"}" | |
>> $GITHUB_OUTPUT | |
- id: set-test-flags | |
run: echo "testflags={\"empty\":\"\", \"basic\":\"--long-running --suites timing | |
demos top\", \"examples\":\"--suite=examples --extra-examples --mpi-script=run_mpi.sh | |
--mpi-nproc=3\", \"types-no-c\":\"--suite=types --skip-languages c cpp\", | |
\"types-c\":\"--suite=types --languages c cpp\", \"long\":\"--long-running\", | |
\"long-mpi\":\"--long-running --mpi-script=run_mpi.sh\", \"examples-backwards\":\"--suite=examples | |
--parametrize-example-name=backwards\", \"examples-sbml\":\"--suites examples | |
--parametrize-language=sbml\", \"long-remote-service\":\"--long-running --remote-service\", | |
\"examples-rpc-lesson3\":\"--suites examples top --parametrize-example-name=rpc_lesson3\", | |
\"tools\":\"tests/test_tools.py\", \"long-interp\":\"--long-running --languages | |
python R matlab --nocapture\", \"services\":\"tests/test_services.py --nocapture\"}" | |
>> $GITHUB_OUTPUT | |
schema: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Update the schema used by the model submission form | |
needs: | |
- test_pip | |
- test_conda | |
- test_rmq_pip | |
- test_rmq_conda | |
- test_stripped | |
- docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: std | |
- name: Install dependencies | |
run: 'python -m pip install PyGithub | |
python utils/setup_test_env.py install pip | |
' | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Update the form | |
run: python utils/update_form_schema.py --token=${{ secrets.YGGDRASIL_UPDATE_TOKEN | |
}} | |
test_conda: | |
defaults: | |
run: | |
shell: bash -l {0} | |
name: Test (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method | |
}}, ${{ matrix.test-flags1 }}, ${{ matrix.test-flags2 }}), Install C = ${{ matrix.install-c | |
}} | |
needs: params | |
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base] | |
}} | |
steps: | |
- name: Set Python version | |
run: echo "PYTHONVERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'min' | |
name: Set Python version to minimum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MIN" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'max' | |
name: Set Python version to maximum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MAX" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'std' | |
name: Set Python version to standard | |
run: echo "PYTHONVERSION=$PYTHONVERSION_STD" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS1: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]}} | |
name: Set test-flags1 | |
run: echo "TEST_FLAGS1=$TEST_FLAGS1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS2: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]}} | |
name: Set test-flags2 | |
run: echo "TEST_FLAGS2=$TEST_FLAGS2" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Set C installation based on matrix value | |
run: echo "INSTALLC=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-mpi != true | |
name: Set MPI installation based on matrix value | |
run: echo "INSTALLMPI=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-sbml == true | |
name: Set SBML installation based on matrix value | |
run: echo "INSTALLSBML=1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Set R installation based on matrix value | |
run: echo "INSTALLR=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-pytorch != true | |
name: Set Pytorch installation based on matrix value | |
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Store an ID string for the job | |
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{ | |
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{ | |
env.YGG_GHA_JOB_ID_SUFFIX }}-${{ matrix.test-flags1 }}-${{ matrix.test-flags2 | |
}}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' | |
name: (WINDOWS) Patch TEMP/TMPDIR on Windows | |
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, 'examples') | |
name: (WINDOWS) Disable interpreted language example on Windows for speed | |
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI | |
== 1 | |
name: (WINDOWS,PIP) Set up MSMPI | |
uses: mpi4py/setup-mpi@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 4.3.3 | |
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip' | |
name: (LINUX,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/.cache/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip' | |
name: (MACOS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/Library/Caches/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip' | |
name: (WINDOWS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~\AppData\Local\pip\Cache | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: matrix.install-method == 'pip' && (env.PYTHONVERSION != 3.7 || runner.os | |
!= 'macOS') | |
name: (PIP) Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHONVERSION }} | |
- if: matrix.install-method == 'pip' && env.PYTHONVERSION == 3.7 && runner.os | |
== 'macOS' | |
name: (PIP) Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.16 | |
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1 | |
name: (PIP) Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows' | |
name: Set up Matlab | |
uses: matlab-actions/setup-matlab@v1 | |
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip' | |
name: (PIP) Set up Virtual Env | |
run: 'python utils/setup_test_env.py env virtualenv ${{ env.PYTHONVERSION }} | |
--env-name=test | |
echo "source activate ygg" > ~/.bashrc | |
source test/bin/activate | |
echo "$VIRTUAL_ENV" | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV | |
' | |
- if: matrix.install-method == 'pip' | |
name: (PIP) Install dependencies & package | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set the vcpkg root config value | |
run: yggconfig --vcpkg-dir=C:\\vcpkg | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: (WINDOWS,PIP) Update R requirements | |
run: ygginstall R --update-r-requirements | |
- if: matrix.install-method == 'pip' && runner.os == 'macOS' | |
name: (MACOS,PIP) Set C compiler to llvm clang | |
run: yggconfig --c-compiler=/opt/homebrew/opt/llvm/bin/clang --c++-compiler=/opt/homebrew/opt/llvm/bin/clang++ | |
- if: runner.os == 'Windows' | |
name: (WINDOWS,CONDA) Prune the PATH variable | |
run: 'echo "PATH=$(python utils/setup_test_env.py prune-path)" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'Windows' && env.INSTALLC == 1 | |
name: (WINDOWS,CONDA) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') | |
name: (CONDA) Set up miniconda base environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channel-priority: strict | |
channels: msys,conda-forge | |
miniforge-variant: Mambaforge | |
python-version: ${{ env.PYTHONVERSION }} | |
use-mamba: true | |
- continue-on-error: true | |
id: conda_build | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Build package in base environment | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Build package in base environment (re-attempt) | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: runner.os == 'Linux' && matrix.install-sbml == true | |
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner | |
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev | |
- continue-on-error: true | |
id: conda_install | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Install dependencies & package from existing build | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Install dependencies & package from existing build (re-attempt) | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Configure | |
run: python utils/setup_test_env.py configure --use-mamba | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'macOS' | |
name: (MACOS,CONDA) Set allow_multiple_omp config | |
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib" | |
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib | |
yggconfig --allow-multiple-omp | |
' | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Compile libraries | |
run: yggcompile | |
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method | |
== 'mamba') | |
name: Run cmake test in command prompt (CONDA) | |
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture | |
--ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Run cmake test in command prompt (PIP) | |
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1 | |
name: Run tests (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} | |
timeout-minutes: 180 | |
- if: ${{ steps.test1.outcome == 'failure' }} | |
name: Re-run test failures (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1_script | |
if: ${{ contains(env.TEST_FLAGS1, '--mpi-script') }} | |
name: Run generated test script (1st) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test1_script.outcome == 'failure' }} | |
name: Re-run test script failures (1st) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2 | |
if: ${{ matrix.test-flags2 != 'empty' }} | |
name: Run tests (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} | |
timeout-minutes: 180 | |
- if: ${{ steps.test2.outcome == 'failure' }} | |
name: Re-run test failures (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} --last-failed --last-failed-no-failures=all | |
--second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2_script | |
if: ${{ matrix.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script') | |
}} | |
name: Run generated test script (2nd) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test2_script.outcome == 'failure' }} | |
name: Re-run test script failures (2nd) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
name: Combine coverage reports | |
run: '# ls .* | |
coverage combine --append | |
' | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Generate XML version of coverage report | |
run: '# ls .* | |
coverage xml -i | |
' | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ env.YGG_GHA_JOB_ID }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- continue-on-error: true | |
if: ${{ always() }} | |
name: Download the last successful workflow environment log | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: . | |
workflow: test-install.yml | |
- if: ${{ always() }} | |
name: Create a log of Python package versions | |
run: python utils/setup_test_env.py log | |
- if: ${{ success() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: new_environment_log.txt | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- install-c: true | |
install-method: conda | |
install-mpi: false | |
install-pytorch: false | |
install-r: false | |
install-sbml: false | |
os-base: ubuntu | |
python-version: 3.7 | |
test-flags1: long | |
test-flags2: empty | |
- install-c: true | |
install-method: conda | |
install-mpi: false | |
install-pytorch: true | |
install-r: true | |
install-sbml: true | |
os-base: ubuntu | |
python-version: 3.9 | |
test-flags1: long-remote-service | |
test-flags2: examples-sbml | |
- install-c: true | |
install-method: conda | |
install-mpi: false | |
install-pytorch: true | |
install-r: true | |
install-sbml: false | |
os-base: ubuntu | |
python-version: '3.10' | |
test-flags1: long | |
test-flags2: empty | |
- install-c: true | |
install-method: conda | |
install-mpi: false | |
install-pytorch: true | |
install-r: true | |
install-sbml: false | |
os-base: ubuntu | |
python-version: '3.11' | |
test-flags1: long | |
test-flags2: empty | |
- install-c: true | |
install-method: conda | |
install-mpi: false | |
install-pytorch: true | |
install-r: true | |
install-sbml: false | |
os-base: macos | |
python-version: 3.8 | |
test-flags1: examples-rpc-lesson3 | |
test-flags2: tools | |
install-c: | |
- true | |
install-method: | |
- conda | |
install-mpi: | |
- true | |
install-pytorch: | |
- true | |
install-r: | |
- true | |
install-sbml: | |
- false | |
os-base: | |
- ubuntu | |
- macos | |
- windows | |
python-version: | |
- std | |
test-flags1: | |
- long-mpi | |
test-flags2: | |
- examples-backwards | |
max-parallel: 20 | |
test_pip: | |
name: Test (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method | |
}}, ${{ matrix.test-flags1 }}, ${{ matrix.test-flags2 }}), Install C = ${{ matrix.install-c | |
}} | |
needs: params | |
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base] | |
}} | |
steps: | |
- name: Set Python version | |
run: echo "PYTHONVERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'min' | |
name: Set Python version to minimum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MIN" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'max' | |
name: Set Python version to maximum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MAX" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'std' | |
name: Set Python version to standard | |
run: echo "PYTHONVERSION=$PYTHONVERSION_STD" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS1: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]}} | |
name: Set test-flags1 | |
run: echo "TEST_FLAGS1=$TEST_FLAGS1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS2: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]}} | |
name: Set test-flags2 | |
run: echo "TEST_FLAGS2=$TEST_FLAGS2" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Set C installation based on matrix value | |
run: echo "INSTALLC=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-mpi != true | |
name: Set MPI installation based on matrix value | |
run: echo "INSTALLMPI=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-sbml == true | |
name: Set SBML installation based on matrix value | |
run: echo "INSTALLSBML=1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Set R installation based on matrix value | |
run: echo "INSTALLR=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-pytorch != true | |
name: Set Pytorch installation based on matrix value | |
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Store an ID string for the job | |
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{ | |
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{ | |
env.YGG_GHA_JOB_ID_SUFFIX }}-${{ matrix.test-flags1 }}-${{ matrix.test-flags2 | |
}}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' | |
name: (WINDOWS) Patch TEMP/TMPDIR on Windows | |
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, 'examples') | |
name: (WINDOWS) Disable interpreted language example on Windows for speed | |
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI | |
== 1 | |
name: (WINDOWS,PIP) Set up MSMPI | |
uses: mpi4py/setup-mpi@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 4.3.3 | |
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip' | |
name: (LINUX,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/.cache/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip' | |
name: (MACOS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/Library/Caches/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip' | |
name: (WINDOWS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~\AppData\Local\pip\Cache | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: matrix.install-method == 'pip' && (env.PYTHONVERSION != 3.7 || runner.os | |
!= 'macOS') | |
name: (PIP) Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHONVERSION }} | |
- if: matrix.install-method == 'pip' && env.PYTHONVERSION == 3.7 && runner.os | |
== 'macOS' | |
name: (PIP) Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.16 | |
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1 | |
name: (PIP) Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows' | |
name: Set up Matlab | |
uses: matlab-actions/setup-matlab@v1 | |
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip' | |
name: (PIP) Set up Virtual Env | |
run: 'python utils/setup_test_env.py env virtualenv ${{ env.PYTHONVERSION }} | |
--env-name=test | |
echo "source activate ygg" > ~/.bashrc | |
source test/bin/activate | |
echo "$VIRTUAL_ENV" | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV | |
' | |
- if: matrix.install-method == 'pip' | |
name: (PIP) Install dependencies & package | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set the vcpkg root config value | |
run: yggconfig --vcpkg-dir=C:\\vcpkg | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: (WINDOWS,PIP) Update R requirements | |
run: ygginstall R --update-r-requirements | |
- if: matrix.install-method == 'pip' && runner.os == 'macOS' | |
name: (MACOS,PIP) Set C compiler to llvm clang | |
run: yggconfig --c-compiler=/opt/homebrew/opt/llvm/bin/clang --c++-compiler=/opt/homebrew/opt/llvm/bin/clang++ | |
- if: runner.os == 'Windows' | |
name: (WINDOWS,CONDA) Prune the PATH variable | |
run: 'echo "PATH=$(python utils/setup_test_env.py prune-path)" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'Windows' && env.INSTALLC == 1 | |
name: (WINDOWS,CONDA) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') | |
name: (CONDA) Set up miniconda base environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channel-priority: strict | |
channels: msys,conda-forge | |
miniforge-variant: Mambaforge | |
python-version: ${{ env.PYTHONVERSION }} | |
use-mamba: true | |
- continue-on-error: true | |
id: conda_build | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Build package in base environment | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Build package in base environment (re-attempt) | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: runner.os == 'Linux' && matrix.install-sbml == true | |
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner | |
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev | |
- continue-on-error: true | |
id: conda_install | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Install dependencies & package from existing build | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Install dependencies & package from existing build (re-attempt) | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Configure | |
run: python utils/setup_test_env.py configure --use-mamba | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'macOS' | |
name: (MACOS,CONDA) Set allow_multiple_omp config | |
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib" | |
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib | |
yggconfig --allow-multiple-omp | |
' | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Compile libraries | |
run: yggcompile | |
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method | |
== 'mamba') | |
name: Run cmake test in command prompt (CONDA) | |
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture | |
--ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Run cmake test in command prompt (PIP) | |
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1 | |
name: Run tests (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} | |
timeout-minutes: 180 | |
- if: ${{ steps.test1.outcome == 'failure' }} | |
name: Re-run test failures (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1_script | |
if: ${{ contains(env.TEST_FLAGS1, '--mpi-script') }} | |
name: Run generated test script (1st) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test1_script.outcome == 'failure' }} | |
name: Re-run test script failures (1st) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2 | |
if: ${{ matrix.test-flags2 != 'empty' }} | |
name: Run tests (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} | |
timeout-minutes: 180 | |
- if: ${{ steps.test2.outcome == 'failure' }} | |
name: Re-run test failures (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} --last-failed --last-failed-no-failures=all | |
--second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2_script | |
if: ${{ matrix.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script') | |
}} | |
name: Run generated test script (2nd) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test2_script.outcome == 'failure' }} | |
name: Re-run test script failures (2nd) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
name: Combine coverage reports | |
run: '# ls .* | |
coverage combine --append | |
' | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Generate XML version of coverage report | |
run: '# ls .* | |
coverage xml -i | |
' | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ env.YGG_GHA_JOB_ID }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- continue-on-error: true | |
if: ${{ always() }} | |
name: Download the last successful workflow environment log | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: . | |
workflow: test-install.yml | |
- if: ${{ always() }} | |
name: Create a log of Python package versions | |
run: python utils/setup_test_env.py log | |
- if: ${{ success() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: new_environment_log.txt | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- install-c: false | |
install-method: pip | |
install-mpi: false | |
install-pytorch: true | |
install-r: false | |
install-sbml: false | |
os-base: windows | |
python-version: std | |
test-flags1: long | |
test-flags2: empty | |
install-c: | |
- true | |
install-method: | |
- pip | |
install-mpi: | |
- true | |
install-pytorch: | |
- true | |
install-r: | |
- true | |
install-sbml: | |
- false | |
os-base: | |
- ubuntu | |
- macos | |
- windows | |
python-version: | |
- std | |
test-flags1: | |
- basic | |
- examples | |
- types-no-c | |
- types-c | |
test-flags2: | |
- empty | |
max-parallel: 20 | |
test_rmq_conda: | |
defaults: | |
run: | |
shell: bash -l {0} | |
env: | |
INSTALLAPY: 1 | |
INSTALLRMQ: 1 | |
USEVIRTUALENV: 1 | |
name: Test RMQ (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method | |
}}) | |
needs: params | |
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base] | |
}} | |
services: | |
rabbitmq: | |
image: rabbitmq:latest | |
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s | |
--health-timeout 5s --health-retries 5 | |
ports: | |
- 5672:5672 | |
steps: | |
- name: Set Python version | |
run: echo "PYTHONVERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'min' | |
name: Set Python version to minimum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MIN" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'max' | |
name: Set Python version to maximum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MAX" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'std' | |
name: Set Python version to standard | |
run: echo "PYTHONVERSION=$PYTHONVERSION_STD" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS1: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]}} | |
name: Set test-flags1 | |
run: echo "TEST_FLAGS1=$TEST_FLAGS1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS2: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]}} | |
name: Set test-flags2 | |
run: echo "TEST_FLAGS2=$TEST_FLAGS2" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Set C installation based on matrix value | |
run: echo "INSTALLC=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-mpi != true | |
name: Set MPI installation based on matrix value | |
run: echo "INSTALLMPI=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-sbml == true | |
name: Set SBML installation based on matrix value | |
run: echo "INSTALLSBML=1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Set R installation based on matrix value | |
run: echo "INSTALLR=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-pytorch != true | |
name: Set Pytorch installation based on matrix value | |
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Store an ID string for the job | |
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{ | |
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{ | |
env.YGG_GHA_JOB_ID_SUFFIX }}-${{ matrix.test-flags1 }}-${{ matrix.test-flags2 | |
}}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' | |
name: (WINDOWS) Patch TEMP/TMPDIR on Windows | |
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, 'examples') | |
name: (WINDOWS) Disable interpreted language example on Windows for speed | |
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI | |
== 1 | |
name: (WINDOWS,PIP) Set up MSMPI | |
uses: mpi4py/setup-mpi@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 4.3.3 | |
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip' | |
name: (LINUX,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/.cache/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip' | |
name: (MACOS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/Library/Caches/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip' | |
name: (WINDOWS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~\AppData\Local\pip\Cache | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: matrix.install-method == 'pip' && (env.PYTHONVERSION != 3.7 || runner.os | |
!= 'macOS') | |
name: (PIP) Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHONVERSION }} | |
- if: matrix.install-method == 'pip' && env.PYTHONVERSION == 3.7 && runner.os | |
== 'macOS' | |
name: (PIP) Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.16 | |
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1 | |
name: (PIP) Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows' | |
name: Set up Matlab | |
uses: matlab-actions/setup-matlab@v1 | |
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip' | |
name: (PIP) Set up Virtual Env | |
run: 'python utils/setup_test_env.py env virtualenv ${{ env.PYTHONVERSION }} | |
--env-name=test | |
echo "source activate ygg" > ~/.bashrc | |
source test/bin/activate | |
echo "$VIRTUAL_ENV" | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV | |
' | |
- if: matrix.install-method == 'pip' | |
name: (PIP) Install dependencies & package | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set the vcpkg root config value | |
run: yggconfig --vcpkg-dir=C:\\vcpkg | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: (WINDOWS,PIP) Update R requirements | |
run: ygginstall R --update-r-requirements | |
- if: matrix.install-method == 'pip' && runner.os == 'macOS' | |
name: (MACOS,PIP) Set C compiler to llvm clang | |
run: yggconfig --c-compiler=/opt/homebrew/opt/llvm/bin/clang --c++-compiler=/opt/homebrew/opt/llvm/bin/clang++ | |
- if: runner.os == 'Windows' | |
name: (WINDOWS,CONDA) Prune the PATH variable | |
run: 'echo "PATH=$(python utils/setup_test_env.py prune-path)" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'Windows' && env.INSTALLC == 1 | |
name: (WINDOWS,CONDA) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') | |
name: (CONDA) Set up miniconda base environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channel-priority: strict | |
channels: msys,conda-forge | |
miniforge-variant: Mambaforge | |
python-version: ${{ env.PYTHONVERSION }} | |
use-mamba: true | |
- continue-on-error: true | |
id: conda_build | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Build package in base environment | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Build package in base environment (re-attempt) | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: runner.os == 'Linux' && matrix.install-sbml == true | |
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner | |
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev | |
- continue-on-error: true | |
id: conda_install | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Install dependencies & package from existing build | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Install dependencies & package from existing build (re-attempt) | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Configure | |
run: python utils/setup_test_env.py configure --use-mamba | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'macOS' | |
name: (MACOS,CONDA) Set allow_multiple_omp config | |
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib" | |
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib | |
yggconfig --allow-multiple-omp | |
' | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Compile libraries | |
run: yggcompile | |
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method | |
== 'mamba') | |
name: Run cmake test in command prompt (CONDA) | |
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture | |
--ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Run cmake test in command prompt (PIP) | |
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1 | |
name: Run tests (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} | |
timeout-minutes: 180 | |
- if: ${{ steps.test1.outcome == 'failure' }} | |
name: Re-run test failures (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1_script | |
if: ${{ contains(env.TEST_FLAGS1, '--mpi-script') }} | |
name: Run generated test script (1st) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test1_script.outcome == 'failure' }} | |
name: Re-run test script failures (1st) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2 | |
if: ${{ matrix.test-flags2 != 'empty' }} | |
name: Run tests (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} | |
timeout-minutes: 180 | |
- if: ${{ steps.test2.outcome == 'failure' }} | |
name: Re-run test failures (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} --last-failed --last-failed-no-failures=all | |
--second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2_script | |
if: ${{ matrix.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script') | |
}} | |
name: Run generated test script (2nd) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test2_script.outcome == 'failure' }} | |
name: Re-run test script failures (2nd) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
name: Combine coverage reports | |
run: '# ls .* | |
coverage combine --append | |
' | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Generate XML version of coverage report | |
run: '# ls .* | |
coverage xml -i | |
' | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ env.YGG_GHA_JOB_ID }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- continue-on-error: true | |
if: ${{ always() }} | |
name: Download the last successful workflow environment log | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: . | |
workflow: test-install.yml | |
- if: ${{ always() }} | |
name: Create a log of Python package versions | |
run: python utils/setup_test_env.py log | |
- if: ${{ success() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: new_environment_log.txt | |
strategy: | |
fail-fast: false | |
matrix: | |
install-c: | |
- true | |
install-method: | |
- conda | |
install-mpi: | |
- false | |
install-pytorch: | |
- true | |
install-r: | |
- true | |
install-sbml: | |
- false | |
os-base: | |
- ubuntu | |
python-version: | |
- std | |
test-flags1: | |
- long-interp | |
test-flags2: | |
- services | |
test_rmq_pip: | |
env: | |
INSTALLAPY: 1 | |
INSTALLRMQ: 1 | |
USEVIRTUALENV: 1 | |
YGG_DEFAULT_COMM: IPCComm | |
name: Test RMQ (${{ matrix.python-version }}, ${{ matrix.os-base }}, ${{ matrix.install-method | |
}}) | |
needs: params | |
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base] | |
}} | |
services: | |
rabbitmq: | |
image: rabbitmq:latest | |
options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s | |
--health-timeout 5s --health-retries 5 | |
ports: | |
- 5672:5672 | |
steps: | |
- name: Set Python version | |
run: echo "PYTHONVERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'min' | |
name: Set Python version to minimum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MIN" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'max' | |
name: Set Python version to maximum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MAX" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'std' | |
name: Set Python version to standard | |
run: echo "PYTHONVERSION=$PYTHONVERSION_STD" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS1: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]}} | |
name: Set test-flags1 | |
run: echo "TEST_FLAGS1=$TEST_FLAGS1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS2: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]}} | |
name: Set test-flags2 | |
run: echo "TEST_FLAGS2=$TEST_FLAGS2" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Set C installation based on matrix value | |
run: echo "INSTALLC=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-mpi != true | |
name: Set MPI installation based on matrix value | |
run: echo "INSTALLMPI=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-sbml == true | |
name: Set SBML installation based on matrix value | |
run: echo "INSTALLSBML=1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Set R installation based on matrix value | |
run: echo "INSTALLR=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-pytorch != true | |
name: Set Pytorch installation based on matrix value | |
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Store an ID string for the job | |
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{ | |
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{ | |
env.YGG_GHA_JOB_ID_SUFFIX }}-${{ matrix.test-flags1 }}-${{ matrix.test-flags2 | |
}}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' | |
name: (WINDOWS) Patch TEMP/TMPDIR on Windows | |
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, 'examples') | |
name: (WINDOWS) Disable interpreted language example on Windows for speed | |
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI | |
== 1 | |
name: (WINDOWS,PIP) Set up MSMPI | |
uses: mpi4py/setup-mpi@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 4.3.3 | |
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip' | |
name: (LINUX,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/.cache/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip' | |
name: (MACOS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/Library/Caches/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip' | |
name: (WINDOWS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~\AppData\Local\pip\Cache | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: matrix.install-method == 'pip' && (env.PYTHONVERSION != 3.7 || runner.os | |
!= 'macOS') | |
name: (PIP) Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHONVERSION }} | |
- if: matrix.install-method == 'pip' && env.PYTHONVERSION == 3.7 && runner.os | |
== 'macOS' | |
name: (PIP) Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.16 | |
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1 | |
name: (PIP) Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows' | |
name: Set up Matlab | |
uses: matlab-actions/setup-matlab@v1 | |
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip' | |
name: (PIP) Set up Virtual Env | |
run: 'python utils/setup_test_env.py env virtualenv ${{ env.PYTHONVERSION }} | |
--env-name=test | |
echo "source activate ygg" > ~/.bashrc | |
source test/bin/activate | |
echo "$VIRTUAL_ENV" | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV | |
' | |
- if: matrix.install-method == 'pip' | |
name: (PIP) Install dependencies & package | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set the vcpkg root config value | |
run: yggconfig --vcpkg-dir=C:\\vcpkg | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: (WINDOWS,PIP) Update R requirements | |
run: ygginstall R --update-r-requirements | |
- if: matrix.install-method == 'pip' && runner.os == 'macOS' | |
name: (MACOS,PIP) Set C compiler to llvm clang | |
run: yggconfig --c-compiler=/opt/homebrew/opt/llvm/bin/clang --c++-compiler=/opt/homebrew/opt/llvm/bin/clang++ | |
- if: runner.os == 'Windows' | |
name: (WINDOWS,CONDA) Prune the PATH variable | |
run: 'echo "PATH=$(python utils/setup_test_env.py prune-path)" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'Windows' && env.INSTALLC == 1 | |
name: (WINDOWS,CONDA) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') | |
name: (CONDA) Set up miniconda base environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channel-priority: strict | |
channels: msys,conda-forge | |
miniforge-variant: Mambaforge | |
python-version: ${{ env.PYTHONVERSION }} | |
use-mamba: true | |
- continue-on-error: true | |
id: conda_build | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Build package in base environment | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Build package in base environment (re-attempt) | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: runner.os == 'Linux' && matrix.install-sbml == true | |
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner | |
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev | |
- continue-on-error: true | |
id: conda_install | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Install dependencies & package from existing build | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Install dependencies & package from existing build (re-attempt) | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Configure | |
run: python utils/setup_test_env.py configure --use-mamba | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'macOS' | |
name: (MACOS,CONDA) Set allow_multiple_omp config | |
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib" | |
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib | |
yggconfig --allow-multiple-omp | |
' | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Compile libraries | |
run: yggcompile | |
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method | |
== 'mamba') | |
name: Run cmake test in command prompt (CONDA) | |
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture | |
--ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Run cmake test in command prompt (PIP) | |
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1 | |
name: Run tests (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} | |
timeout-minutes: 180 | |
- if: ${{ steps.test1.outcome == 'failure' }} | |
name: Re-run test failures (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1_script | |
if: ${{ contains(env.TEST_FLAGS1, '--mpi-script') }} | |
name: Run generated test script (1st) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test1_script.outcome == 'failure' }} | |
name: Re-run test script failures (1st) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2 | |
if: ${{ matrix.test-flags2 != 'empty' }} | |
name: Run tests (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} | |
timeout-minutes: 180 | |
- if: ${{ steps.test2.outcome == 'failure' }} | |
name: Re-run test failures (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} --last-failed --last-failed-no-failures=all | |
--second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2_script | |
if: ${{ matrix.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script') | |
}} | |
name: Run generated test script (2nd) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test2_script.outcome == 'failure' }} | |
name: Re-run test script failures (2nd) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
name: Combine coverage reports | |
run: '# ls .* | |
coverage combine --append | |
' | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Generate XML version of coverage report | |
run: '# ls .* | |
coverage xml -i | |
' | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ env.YGG_GHA_JOB_ID }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- continue-on-error: true | |
if: ${{ always() }} | |
name: Download the last successful workflow environment log | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: . | |
workflow: test-install.yml | |
- if: ${{ always() }} | |
name: Create a log of Python package versions | |
run: python utils/setup_test_env.py log | |
- if: ${{ success() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: new_environment_log.txt | |
strategy: | |
fail-fast: false | |
matrix: | |
install-c: | |
- true | |
install-method: | |
- pip | |
install-mpi: | |
- false | |
install-pytorch: | |
- true | |
install-r: | |
- true | |
install-sbml: | |
- false | |
os-base: | |
- ubuntu | |
python-version: | |
- std | |
test-flags1: | |
- long-interp | |
test-flags2: | |
- empty | |
test_stripped: | |
env: | |
INSTALLC: 0 | |
INSTALLFORTRAN: 0 | |
INSTALLLPY: 0 | |
INSTALLMPI: 0 | |
INSTALLPYGMENTS: 0 | |
INSTALLR: 0 | |
INSTALLRMQ: 0 | |
INSTALLTRIMESH: 0 | |
INSTALLZMQ: 0 | |
YGG_GHA_JOB_ID_SUFFIX: -stripped | |
name: Test stripped install (${{ matrix.python-version }}, ${{ matrix.os-base | |
}}, ${{ matrix.install-method }}) | |
needs: params | |
runs-on: ${{ matrix.os-base }}-${{ fromJSON(needs.params.outputs.os-versions)[matrix.os-base] | |
}} | |
steps: | |
- name: Set Python version | |
run: echo "PYTHONVERSION=${{ matrix.python-version }}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'min' | |
name: Set Python version to minimum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MIN" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'max' | |
name: Set Python version to maximum | |
run: echo "PYTHONVERSION=$PYTHONVERSION_MAX" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.python-version == 'std' | |
name: Set Python version to standard | |
run: echo "PYTHONVERSION=$PYTHONVERSION_STD" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS1: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags1]}} | |
name: Set test-flags1 | |
run: echo "TEST_FLAGS1=$TEST_FLAGS1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- env: | |
TEST_FLAGS2: ${{fromJSON(needs.params.outputs.test-flags)[matrix.test-flags2]}} | |
name: Set test-flags2 | |
run: echo "TEST_FLAGS2=$TEST_FLAGS2" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Get tags required by setuptools_scm to generate version | |
run: 'git fetch --prune --unshallow | |
git fetch --depth=1 origin +refs/tags/*:refs/tags/* | |
' | |
- if: matrix.install-c != true && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Set C installation based on matrix value | |
run: echo "INSTALLC=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-mpi != true | |
name: Set MPI installation based on matrix value | |
run: echo "INSTALLMPI=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-sbml == true | |
name: Set SBML installation based on matrix value | |
run: echo "INSTALLSBML=1" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Set R installation based on matrix value | |
run: echo "INSTALLR=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: matrix.install-pytorch != true | |
name: Set Pytorch installation based on matrix value | |
run: echo "INSTALLPYTORCH=0" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- name: Store an ID string for the job | |
run: echo "YGG_GHA_JOB_ID=${{ runner.os }}-${{ matrix.install-method }}-py${{ | |
matrix.python-version }}-C${{ env.INSTALLC }}-RMQ${{ env.INSTALLRMQ }}${{ | |
env.YGG_GHA_JOB_ID_SUFFIX }}-${{ matrix.test-flags1 }}-${{ matrix.test-flags2 | |
}}" >> $GITHUB_ENV | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' | |
name: (WINDOWS) Patch TEMP/TMPDIR on Windows | |
run: 'echo "TMPDIR=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
echo "TEMP=$USERPROFILE\\AppData\\Local\\Temp" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && startsWith(matrix.test-flags1, 'examples') | |
name: (WINDOWS) Disable interpreted language example on Windows for speed | |
run: 'echo "TEST_FLAGS1_SUFFIX=--skip-languages python R julia" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLMPI | |
== 1 | |
name: (WINDOWS,PIP) Set up MSMPI | |
uses: mpi4py/setup-mpi@v1 | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 4.3.3 | |
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip' | |
name: (LINUX,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/.cache/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'macOS') && matrix.install-method == 'pip' | |
name: (MACOS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~/Library/Caches/pip | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: startsWith(runner.os, 'Windows') && matrix.install-method == 'pip' | |
name: (WINDOWS,PIP) Cache pip | |
uses: actions/cache@v4 | |
with: | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
path: ~\AppData\Local\pip\Cache | |
restore-keys: '${{ runner.os }}-pip- | |
' | |
- if: matrix.install-method == 'pip' && (env.PYTHONVERSION != 3.7 || runner.os | |
!= 'macOS') | |
name: (PIP) Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHONVERSION }} | |
- if: matrix.install-method == 'pip' && env.PYTHONVERSION == 3.7 && runner.os | |
== 'macOS' | |
name: (PIP) Set up Python 3.7 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.7.16 | |
- if: matrix.install-method == 'pip' && env.INSTALLJULIA == 1 | |
name: (PIP) Set up Julia | |
uses: julia-actions/setup-julia@v1 | |
- if: env.INSTALLMATLAB == 1 && runner.os != 'Windows' | |
name: Set up Matlab | |
uses: matlab-actions/setup-matlab@v1 | |
- if: env.USEVIRTUALENV == 1 && matrix.install-method == 'pip' | |
name: (PIP) Set up Virtual Env | |
run: 'python utils/setup_test_env.py env virtualenv ${{ env.PYTHONVERSION }} | |
--env-name=test | |
echo "source activate ygg" > ~/.bashrc | |
source test/bin/activate | |
echo "$VIRTUAL_ENV" | |
echo "VIRTUAL_ENV=$VIRTUAL_ENV" >> $GITHUB_ENV | |
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV | |
' | |
- if: matrix.install-method == 'pip' | |
name: (PIP) Install dependencies & package | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLC | |
== 1 | |
name: (WINDOWS,PIP) Set the vcpkg root config value | |
run: yggconfig --vcpkg-dir=C:\\vcpkg | |
- if: runner.os == 'Windows' && matrix.install-method == 'pip' && env.INSTALLR | |
== 1 | |
name: (WINDOWS,PIP) Update R requirements | |
run: ygginstall R --update-r-requirements | |
- if: matrix.install-method == 'pip' && runner.os == 'macOS' | |
name: (MACOS,PIP) Set C compiler to llvm clang | |
run: yggconfig --c-compiler=/opt/homebrew/opt/llvm/bin/clang --c++-compiler=/opt/homebrew/opt/llvm/bin/clang++ | |
- if: runner.os == 'Windows' | |
name: (WINDOWS,CONDA) Prune the PATH variable | |
run: 'echo "PATH=$(python utils/setup_test_env.py prune-path)" >> $GITHUB_ENV | |
' | |
shell: bash -l {0} | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'Windows' && env.INSTALLC == 1 | |
name: (WINDOWS,CONDA) Set up MSVC Compiler | |
uses: ilammy/msvc-dev-cmd@v1 | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') | |
name: (CONDA) Set up miniconda base environment | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
channel-priority: strict | |
channels: msys,conda-forge | |
miniforge-variant: Mambaforge | |
python-version: ${{ env.PYTHONVERSION }} | |
use-mamba: true | |
- continue-on-error: true | |
id: conda_build | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Build package in base environment | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: ${{ steps.conda_build.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Build package in base environment (re-attempt) | |
run: 'conda deactivate | |
conda activate base | |
python utils/setup_test_env.py build ${{ matrix.install-method }} --python | |
${{ env.PYTHONVERSION }} --use-mamba | |
' | |
- if: runner.os == 'Linux' && matrix.install-sbml == true | |
name: (LINUX) Install ncurses 5 for SBML runs with libroadrunner | |
run: sudo apt-get install libncurses5 libncurses5-dev libncursesw5-dev | |
- continue-on-error: true | |
id: conda_install | |
if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Install dependencies & package from existing build | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: ${{ steps.conda_install.outcome == 'failure' && (matrix.install-method == | |
'conda' || matrix.install-method == 'mamba')}} | |
name: (CONDA) Install dependencies & package from existing build (re-attempt) | |
run: python utils/setup_test_env.py install ${{ matrix.install-method }} --without-build | |
--use-mamba | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Configure | |
run: python utils/setup_test_env.py configure --use-mamba | |
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba') && | |
runner.os == 'macOS' | |
name: (MACOS,CONDA) Set allow_multiple_omp config | |
run: '[[ -d $CONDA_PREFIX/lib/clang/9.0.1 ]] && install_name_tool -change "@rpath/libc++abi.1.dylib" | |
"/usr/lib/libc++abi.1.dylib" $CONDA_PREFIX/lib/clang/9.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib | |
yggconfig --allow-multiple-omp | |
' | |
- name: Verify installation | |
run: 'python -m pip install setuptools_scm | |
python utils/setup_test_env.py verify | |
' | |
- name: Compile libraries | |
run: yggcompile | |
- if: runner.os == 'Windows' && (matrix.install-method == 'conda' || matrix.install-method | |
== 'mamba') | |
name: Run cmake test in command prompt (CONDA) | |
run: CALL "%CONDA_BAT%" activate test && pytest --ci --cov-append --nocapture | |
--ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- if: runner.os == 'Windows' && matrix.install-method != 'conda' && matrix.install-method | |
!= 'mamba' | |
name: Run cmake test in command prompt (PIP) | |
run: pytest --ci --cov-append --nocapture --ygg-debug tests/drivers/test_CMakeModelDriver.py | |
shell: cmd /C CALL {0} | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1 | |
name: Run tests (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} | |
timeout-minutes: 180 | |
- if: ${{ steps.test1.outcome == 'failure' }} | |
name: Re-run test failures (1st) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS1 }} ${{ env.TEST_FLAGS1_SUFFIX | |
}} --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test1_script | |
if: ${{ contains(env.TEST_FLAGS1, '--mpi-script') }} | |
name: Run generated test script (1st) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test1_script.outcome == 'failure' }} | |
name: Re-run test script failures (1st) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2 | |
if: ${{ matrix.test-flags2 != 'empty' }} | |
name: Run tests (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} | |
timeout-minutes: 180 | |
- if: ${{ steps.test2.outcome == 'failure' }} | |
name: Re-run test failures (2nd) | |
run: pytest --ci --cov-append ${{ env.TEST_FLAGS2 }} --last-failed --last-failed-no-failures=all | |
--second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
id: test2_script | |
if: ${{ matrix.test-flags2 != 'empty' && contains(env.TEST_FLAGS2, '--mpi-script') | |
}} | |
name: Run generated test script (2nd) | |
run: ./run_mpi.sh | |
timeout-minutes: 180 | |
- if: ${{ steps.test2_script.outcome == 'failure' }} | |
name: Re-run test script failures (2nd) | |
run: ./run_mpi.sh --last-failed --last-failed-no-failures=all --second-attempt | |
timeout-minutes: 180 | |
- continue-on-error: true | |
name: Combine coverage reports | |
run: '# ls .* | |
coverage combine --append | |
' | |
- if: matrix.install-method == 'conda' || matrix.install-method == 'mamba' | |
name: (CONDA) Generate XML version of coverage report | |
run: '# ls .* | |
coverage xml -i | |
' | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v4 | |
with: | |
name: ${{ env.YGG_GHA_JOB_ID }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- continue-on-error: true | |
if: ${{ always() }} | |
name: Download the last successful workflow environment log | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: . | |
workflow: test-install.yml | |
- if: ${{ always() }} | |
name: Create a log of Python package versions | |
run: python utils/setup_test_env.py log | |
- if: ${{ success() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: environment-log-${{ env.YGG_GHA_JOB_ID }} | |
path: new_environment_log.txt | |
strategy: | |
fail-fast: false | |
matrix: | |
install-c: | |
- false | |
install-method: | |
- pip | |
install-mpi: | |
- false | |
install-pytorch: | |
- true | |
install-r: | |
- true | |
install-sbml: | |
- false | |
os-base: | |
- ubuntu | |
- macos | |
- windows | |
python-version: | |
- std | |
test-flags1: | |
- long | |
test-flags2: | |
- empty | |
upload_sdist: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Upload sdist | |
needs: | |
- build_sdist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: sdist | |
path: dist | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.pypi }} | |
skip_existing: true | |
user: __token__ | |
upload_wheels: | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
name: Upload wheels | |
needs: | |
- build_wheels | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.pypi }} | |
skip_existing: true | |
user: __token__ | |
name: Test of package installation & execution | |
'on': | |
push: | |
branches-ignore: | |
- gh-pages | |
tags: | |
- '*' | |
schedule: | |
- cron: 0 10 * * 1 | |
- cron: 0 10 1 * * |