Skip to content

Test of package installation & execution #1528

Test of package installation & execution

Test of package installation & execution #1528

Workflow file for this run

# 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: 1
INSTALLLPY: 0
INSTALLMATLAB: 0
INSTALLMPI: 1
INSTALLOMP: 1
INSTALLPYGMENTS: 1
INSTALLPYTORCH: 1
INSTALLR: 1
INSTALLRMQ: 0
INSTALLSBML: 0
INSTALLSEQ: 1
INSTALLTRIMESH: 1
INSTALLZMQ: 1
NUMPY: numpy
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@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Build sdist
run: 'python setup.py 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 --import-mode=importlib 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@v3
with:
submodules: true
- 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@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- 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@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: python utils/setup_test_env.py install pip
- name: Verify installation
run: 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 }}
runs-on: ubuntu-latest
steps:
- id: set-os-versions
run: echo "versions={\"ubuntu\":\"latest\", \"macos\":\"latest\", \"windows\":\"latest\"}"
>> $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@v3
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: 'python -m pip install PyGithub
python utils/setup_test_env.py install pip
'
- name: Verify installation
run: 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:
- uses: actions/checkout@v3
with:
submodules: true
- 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: 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 }}" >> $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, '--suite=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
with:
toolset: 14.0
- 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.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
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@v3
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@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
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 ${{ matrix.python-version
}} --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=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- 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
with:
toolset: 14.0
- 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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- 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') &&
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 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: conda activate test && pytest --import-mode=importlib --ci --cov-append
--nocapture 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 --import-mode=importlib --ci --cov-append --nocapture 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 --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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(matrix.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 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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 != '' && contains(matrix.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@v3
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@v2
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@v3
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-sbml: false
os-base: ubuntu
python-version: 3.6
test-flags1: --long-running
test-flags2: ''
- install-c: true
install-method: conda
install-mpi: false
install-sbml: false
os-base: ubuntu
python-version: 3.8
test-flags1: --long-running
test-flags2: ''
- install-c: true
install-method: conda
install-mpi: false
install-sbml: true
os-base: ubuntu
python-version: 3.9
test-flags1: --long-running --remote-service
test-flags2: --suites examples --parametrize-language=sbml
- install-c: true
install-method: conda
install-mpi: false
install-sbml: false
os-base: macos
python-version: 3.8
test-flags1: --suites examples top --parametrize-example-name=rpc_lesson3
test-flags2: tests/test_tools.py
install-c:
- true
install-method:
- conda
install-mpi:
- true
install-sbml:
- false
os-base:
- ubuntu
- macos
- windows
python-version:
- 3.7
test-flags1:
- --long-running --mpi-script=run_mpi.sh
test-flags2:
- --suite=examples --parametrize-example-name=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:
- uses: actions/checkout@v3
with:
submodules: true
- 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: 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 }}" >> $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, '--suite=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
with:
toolset: 14.0
- 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.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
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@v3
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@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
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 ${{ matrix.python-version
}} --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=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- 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
with:
toolset: 14.0
- 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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- 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') &&
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 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: conda activate test && pytest --import-mode=importlib --ci --cov-append
--nocapture 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 --import-mode=importlib --ci --cov-append --nocapture 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 --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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(matrix.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 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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 != '' && contains(matrix.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@v3
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@v2
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@v3
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-sbml: false
os-base: windows
python-version: 3.7
test-flags1: --long-running
test-flags2: ''
install-c:
- true
install-method:
- pip
install-mpi:
- true
install-sbml:
- false
os-base:
- ubuntu
- macos
- windows
python-version:
- 3.7
test-flags1:
- --long-running --suites timing demos top
- --suite=examples --extra-examples --mpi-script=run_mpi.sh --mpi-nproc=3
- --suite=types --skip-languages c cpp
- --suite=types --languages c cpp
test-flags2:
- ''
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:
- uses: actions/checkout@v3
with:
submodules: true
- 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: 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 }}" >> $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, '--suite=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
with:
toolset: 14.0
- 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.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
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@v3
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@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
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 ${{ matrix.python-version
}} --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=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- 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
with:
toolset: 14.0
- 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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- 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') &&
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 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: conda activate test && pytest --import-mode=importlib --ci --cov-append
--nocapture 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 --import-mode=importlib --ci --cov-append --nocapture 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 --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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(matrix.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 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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 != '' && contains(matrix.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@v3
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@v2
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@v3
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-sbml:
- false
os-base:
- ubuntu
python-version:
- 3.7
test-flags1:
- --long-running --languages python R matlab
test-flags2:
- tests/test_services.py --nocapture
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:
- uses: actions/checkout@v3
with:
submodules: true
- 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: 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 }}" >> $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, '--suite=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
with:
toolset: 14.0
- 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.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
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@v3
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@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
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 ${{ matrix.python-version
}} --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=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- 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
with:
toolset: 14.0
- 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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- 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') &&
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 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: conda activate test && pytest --import-mode=importlib --ci --cov-append
--nocapture 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 --import-mode=importlib --ci --cov-append --nocapture 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 --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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(matrix.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 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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 != '' && contains(matrix.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@v3
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@v2
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@v3
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-sbml:
- false
os-base:
- ubuntu
python-version:
- 3.7
test-flags1:
- --long-running --languages python R matlab
test-flags2:
- ''
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:
- uses: actions/checkout@v3
with:
submodules: true
- 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: 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 }}" >> $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, '--suite=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
with:
toolset: 14.0
- 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.2.3
- if: startsWith(runner.os, 'Linux') && matrix.install-method == 'pip'
name: (LINUX,PIP) Cache pip
uses: actions/cache@v3
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@v3
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@v3
with:
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: ~\AppData\Local\pip\Cache
restore-keys: '${{ runner.os }}-pip-
'
- if: matrix.install-method == 'pip' && (matrix.python-version != 3.7 || runner.os
!= 'macOS')
name: (PIP) Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- if: matrix.install-method == 'pip' && matrix.python-version == 3.7 && runner.os
== 'macOS'
name: (PIP) Set up Python 3.7
uses: actions/setup-python@v4
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 ${{ matrix.python-version
}} --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=/usr/local/opt/llvm/bin/clang --c++-compiler=/usr/local/opt/llvm/bin/clang++
- if: (matrix.install-method == 'conda' || matrix.install-method == 'mamba')
name: (CONDA) Set up miniconda base environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channel-priority: strict
channels: conda-forge
miniforge-variant: Mambaforge
python-version: ${{ matrix.python-version }}
use-mamba: true
use-only-tar-bz2: true
- 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
with:
toolset: 14.0
- 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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --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 activate base
python utils/setup_test_env.py build ${{ matrix.install-method }} --python
${{ matrix.python-version }} --use-mamba
'
- if: runner.os == 'macOS' && (matrix.install-method == 'conda' || matrix.install-method
== 'mamba')
name: (MACOS,CONDA) Install old MacOSX SDK for compatibility with the conda
llvm (7)
run: ./utils/setup_old_mac_sdk.sh
- 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') &&
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 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: conda activate test && pytest --import-mode=importlib --ci --cov-append
--nocapture 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 --import-mode=importlib --ci --cov-append --nocapture 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 --import-mode=importlib --ci --cov-append ${{ matrix.test-flags1
}} ${{ env.TEST_FLAGS1_SUFFIX }}
timeout-minutes: 180
- if: ${{ steps.test1.outcome == 'failure' }}
name: Re-run test failures (1st)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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(matrix.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 != '' }}
name: Run tests (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.test-flags2
}}
timeout-minutes: 180
- if: ${{ steps.test2.outcome == 'failure' }}
name: Re-run test failures (2nd)
run: pytest --import-mode=importlib --ci --cov-append ${{ matrix.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 != '' && contains(matrix.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@v3
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@v2
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@v3
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-sbml:
- false
os-base:
- ubuntu
- macos
- windows
python-version:
- 3.7
test-flags1:
- --long-running
test-flags2:
- ''
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 * *