Skip to content

Improve error handling for the bubble solver #210

Improve error handling for the bubble solver

Improve error handling for the bubble solver #210

Workflow file for this run

name: Test on macOS
on:
push:
workflow_dispatch:
# workflow_run:
# workflows: [ CI ]
# types: [ completed ]
env:
PRIMARY_PYTHON_VERSION: '3.11'
jobs:
test:
runs-on: macos-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 20
steps:
# Fortran compiler is required for building numbalsoda if a wheel is not available
- uses: awvwgk/setup-fortran@v1
id: setup-fortran
with:
compiler: "gcc"
version: "12"
- name: Setup Python
uses: actions/setup-python@v4
# macOS minutes cost 10x what Linux does, so testing multiple Python versions would be quite costly
with:
python-version: ${{ env.PRIMARY_PYTHON_VERSION }}
- name: Print Python version
run: python -V
- name: Checkout
uses: actions/checkout@v3
- name: Load pip cache
uses: actions/cache@v3
with:
path: .pip
key: pip-${{ runner.os }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
pip-${{ runner.os }}-
pip-
- name: Install requirements
run: |
pip --cache-dir=.pip install --upgrade pip
pip --cache-dir=.pip install --upgrade wheel
pip --cache-dir=.pip install -r requirements.txt -r requirements-dev.txt
- name: Print Numba sysinfo
# On macOS the Numba script is not executable by default and therefore has to be called as a Python module.
run: |
python -m numba --sysinfo | tee numba-sysinfo.txt
- name: Generate reference data
run: python3 pttools/bubble/fluid_reference.py
env:
PYTHONPATH: .
- name: Run tests
run: |
set -o pipefail
NUMBA_NESTED_PARALLELISM=0 pytest | tee test-output.txt
coverage json
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: Test results with Numba
path: |
coverage.xml
coverage.json
htmlcov
numba-sysinfo.txt
test-output.txt
test-results
if-no-files-found: error