Bump actions/upload-artifact from 5 to 6 (#3109) #14045
This file contains hidden or 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
| name: C++/Python Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release*' | |
| merge_group: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| ubuntu-cpp-python-tests: | |
| name: C++/Python tests Ubuntu | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| python-version: [ "3.14" ] | |
| steps: | |
| - name: Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cache/pooch | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| - run: git fetch --prune --unshallow | |
| - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV | |
| - name: Set up AMICI C++ libraries | |
| uses: ./.github/actions/setup-amici-cpp | |
| - name: Install libsuitesparse-dev | |
| # We don't need libsuitesparse-dev, but let's have it installed, | |
| # to ensure that its presence does not break the build | |
| run: sudo apt-get install -y libsuitesparse-dev | |
| - name: C++ tests | |
| run: scripts/run-cpp-tests.sh | |
| - name: Install python package | |
| env: | |
| CMAKE_EXPORT_COMPILE_COMMANDS: "ON" | |
| run: scripts/installAmiciSource.sh | |
| - name: Check OpenMP support | |
| run: source venv/bin/activate && python -c "from amici.sim.sundials import compiled_with_openmp; import sys; sys.exit(not compiled_with_openmp())" | |
| - name: Python tests (part 1) | |
| run: | | |
| source venv/bin/activate \ | |
| && pytest \ | |
| --ignore-glob=*petab* \ | |
| --ignore-glob=*test_splines.py \ | |
| --ignore-glob=*test_splines_short.py \ | |
| --ignore-glob=*test_pysb.py \ | |
| --cov=amici \ | |
| --cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \ | |
| --cov-append \ | |
| --durations=10 \ | |
| ${AMICI_DIR}/python/tests | |
| - name: Python tests splines | |
| if: ${{ github.base_ref == 'master' || github.event.merge_group.base_ref == 'master'}} | |
| run: | | |
| source venv/bin/activate \ | |
| && pytest \ | |
| --cov=amici \ | |
| --cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \ | |
| --cov-append \ | |
| --durations=10 \ | |
| ${AMICI_DIR}/python/tests/test_splines.py | |
| - name: Codecov Python | |
| if: (github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev') && github.actor != 'dependabot[bot]' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: build/coverage_py.xml | |
| flags: python | |
| fail_ci_if_error: true | |
| verbose: true | |
| - name: Capture coverage info (lcov) | |
| run: | | |
| lcov --compat-libtool --no-external \ | |
| -d ${AMICI_DIR}/build/CMakeFiles/amici.dir/src \ | |
| -b ${AMICI_DIR} -c -o coverage_cpp.info \ | |
| && lcov --compat-libtool --no-external \ | |
| -d ${AMICI_DIR}/python/sdist/build/temp_amici/CMakeFiles/amici.dir/src \ | |
| -b ${AMICI_DIR}/python/sdist -c -o coverage_py.info \ | |
| && lcov -a coverage_cpp.info -a coverage_py.info -o coverage.info | |
| - name: Codecov CPP | |
| if: (github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev') && github.actor != 'dependabot[bot]' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.info | |
| flags: cpp | |
| fail_ci_if_error: true | |
| - name: Run sonar-scanner | |
| if: ${{ env.SONAR_TOKEN != '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| sonar-scanner \ | |
| -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json \ | |
| -Dsonar.projectVersion="$(git describe --abbrev=4 --dirty=-dirty --always --tags | tr -d '\n')" | |
| ubuntu-python-tests: | |
| name: Python tests Ubuntu | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| python-version: [ "3.14" ] | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cache/pooch | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| - uses: actions/checkout@v6 | |
| - run: git fetch --prune --unshallow | |
| - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV | |
| - name: Set up AMICI C++ libraries | |
| uses: ./.github/actions/setup-amici-cpp | |
| - name: Install python package | |
| env: | |
| CMAKE_EXPORT_COMPILE_COMMANDS: "ON" | |
| run: scripts/installAmiciSource.sh | |
| - name: Python tests | |
| run: | | |
| source venv/bin/activate \ | |
| && pytest \ | |
| --cov=amici \ | |
| --cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \ | |
| --cov-append \ | |
| --durations=10 \ | |
| ${AMICI_DIR}/python/tests/test_pysb.py \ | |
| ${AMICI_DIR}/python/tests/test_splines_short.py | |
| - name: Codecov Python | |
| if: (github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev') && github.actor != 'dependabot[bot]' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: build/coverage_py.xml | |
| flags: python | |
| fail_ci_if_error: true | |
| verbose: true | |
| - name: Capture coverage info (lcov) | |
| run: | | |
| lcov --compat-libtool --no-external \ | |
| -d ${AMICI_DIR}/build/CMakeFiles/amici.dir/src \ | |
| -b ${AMICI_DIR} -c -o coverage_cpp.info \ | |
| && lcov --compat-libtool --no-external \ | |
| -d ${AMICI_DIR}/python/sdist/build/temp_amici/CMakeFiles/amici.dir/src \ | |
| -b ${AMICI_DIR}/python/sdist -c -o coverage_py.info \ | |
| && lcov -a coverage_cpp.info -a coverage_py.info -o coverage.info | |
| - name: Codecov CPP | |
| if: (github.event_name == 'pull_request' || github.repository_owner == 'AMICI-dev') && github.actor != 'dependabot[bot]' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: coverage.info | |
| flags: cpp_python | |
| fail_ci_if_error: true | |
| - name: Run sonar-scanner | |
| if: ${{ env.SONAR_TOKEN != '' }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| sonar-scanner \ | |
| -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json \ | |
| -Dsonar.projectVersion="$(git describe --abbrev=4 --dirty=-dirty --always --tags | tr -d '\n')" | |
| ubuntu-notebook-tests: | |
| name: Notebook tests Ubuntu | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| matrix: | |
| python-version: [ "3.11" ] | |
| steps: | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cache/pooch | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| - uses: actions/checkout@v6 | |
| - run: git fetch --prune --unshallow | |
| - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV | |
| - name: Set up AMICI C++ libraries | |
| uses: ./.github/actions/setup-amici-cpp | |
| - name: Install python package | |
| run: scripts/installAmiciSource.sh | |
| - name: example notebooks | |
| run: scripts/runNotebook.sh doc/examples/example_*/ | |
| - name: getting started notebooks | |
| run: scripts/runNotebook.sh doc/getting_started* | |
| # TODO: Include notebooks in coverage report | |
| macos_cpp_py: | |
| name: Tests MacOS C++/Python | |
| runs-on: macos-latest | |
| env: | |
| PYTHONFAULTHANDLER: "1" | |
| steps: | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| - run: git fetch --prune --unshallow | |
| - name: Install dependencies | |
| uses: ./.github/actions/install-macos-dependencies | |
| - name: homebrew | |
| run: brew install cppcheck | |
| - name: Build AMICI | |
| run: scripts/buildAll.sh | |
| - name: Install python package | |
| run: scripts/installAmiciSource.sh | |
| - name: Check OpenMP support | |
| run: source venv/bin/activate && python -c "from amici.sim.sundials import compiled_with_openmp; import sys; sys.exit(not compiled_with_openmp())" | |
| - name: cppcheck | |
| run: scripts/run-cppcheck.sh | |
| - name: C++ tests | |
| run: scripts/run-cpp-tests.sh | |
| - name: Get Pooch Cache Directory | |
| id: get-pooch-cache | |
| run: | | |
| echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV | |
| - name: Cache Pooch Directory | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.pooch-cache }} | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| - name: Python tests | |
| run: | | |
| scripts/run-python-tests.sh \ | |
| test_pregenerated_models.py \ | |
| test_splines_short.py \ | |
| test_misc.py | |
| macos_python: | |
| name: Tests MacOS Python | |
| # stick to macos-14 for now. tests on macos-15 take super long | |
| # https://github.com/AMICI-dev/AMICI/issues/2996 | |
| runs-on: macos-14 | |
| env: | |
| PYTHONFAULTHANDLER: "1" | |
| steps: | |
| - name: Cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/Library/Caches/pooch | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/checkout@v6 | |
| with: | |
| lfs: true | |
| - run: git fetch --prune --unshallow | |
| - name: Install dependencies | |
| uses: ./.github/actions/install-macos-dependencies | |
| - name: Install python package | |
| run: | | |
| pip show numpy > /dev/null || python3 -m pip install numpy | |
| scripts/installAmiciSource.sh | |
| - name: Check OpenMP support | |
| run: source venv/bin/activate && python -c "from amici.sim.sundials import compiled_with_openmp; import sys; sys.exit(not compiled_with_openmp())" | |
| - name: Get BioNetGen | |
| run: scripts/buildBNGL.sh | |
| - name: Get Pooch Cache Directory | |
| id: get-pooch-cache | |
| run: | | |
| echo "pooch-cache=$(source venv/bin/activate && python -c 'import pooch; print(pooch.os_cache("pooch"))')" >> $GITHUB_ENV | |
| - name: Cache Pooch Directory | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ env.pooch-cache }} | |
| key: ${{ runner.os }}-py${{ matrix.python-version }}-${{ github.job }} | |
| - name: Install PEtab benchmark collection | |
| run: | | |
| git clone --depth 1 https://github.com/benchmarking-initiative/Benchmark-Models-PEtab.git \ | |
| && export BENCHMARK_COLLECTION="$(pwd)/Benchmark-Models-PEtab/Benchmark-Models/" \ | |
| && source venv/bin/activate && python -m pip install -e $BENCHMARK_COLLECTION/../src/python | |
| - name: Python tests | |
| run: | | |
| scripts/run-python-tests.sh \ | |
| --ignore=test_pregenerated_models.py \ | |
| --ignore=test_splines_short.py \ | |
| --ignore=test_misc.py |