Skip to content

Stage code

Stage code #63

name: Python package
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libmpich-dev \
python3-dev
mpichversion
which mpiexec
mpiexec --version
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install parareal package
run: |
pip install -e .
- name: Run MPI tests
run: |
echo "Running MPI tests with Python ${{ matrix.python-version }}"
timeout 5m mpiexec -n 2 python -m pytest tests/test_mpi_parareal.py
env:
MPIEXEC_TIMEOUT: 300
- name: Run standard tests
run: |
pytest ./tests
- name: Generate coverage report
run: |
pytest --cov=your_package --cov-report=xml
continue-on-error: true
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
continue-on-error: true