Skip to content

CI

CI #44

Workflow file for this run

name: "CI"
on:
pull_request:
branches:
- main
- develop
paths-ignore:
- "docs/*"
push:
branches:
- main
- develop
schedule:
# At 07:00 UTC on Monday and Thursday
- cron: "0 7 * * *"
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
tests:
runs-on: ${{ matrix.os }}
name: "${{ matrix.os }} - ${{ matrix.python-version }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version:
- "3.10"
- "3.11"
- "3.12"
include:
- os: "macos-latest"
python-version: "3.12"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: pontibus
create-args: >-
python=${{ matrix.python-version }}
init-shell: bash
- name: "Install"
run: python -m pip install --no-deps -e .
- name: "Test imports"
run: |
# if we add more to this, consider changing to for + env vars
python -Ic "import pontibus; print(pontibus.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
pip list
- name: "Run tests"
env:
PONTIBUS_SLOW_TESTS: ${{ fromJSON('{"false":"false","true":"true"}')[github.event_name != 'pull_request'] }}
DUECREDIT_ENABLE: 'yes'
run: |
pytest -n logical -v --cov=pontibus --cov-report=xml --durations=10
- name: codecov-pr
if: ${{ github.repository == 'OpenFreeEnergy/pontibus'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: False
verbose: True
flags: fast-tests