Skip to content

CI

CI #1944

Workflow file for this run

name: "CI"
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
# At 07:00 UTC on Monday and Thursday.
- cron: "0 7 * * *"
release:
types:
- published
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
tests:
runs-on: ${{ matrix.OS }}-latest
name: "tests"
strategy:
fail-fast: false
matrix:
os: ['ubuntu', 'macos']
python-version:
- "3.9"
- "3.10"
exclude:
- os: 'macos'
python-version: "3.9"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# More info on options: https://github.com/conda-incubator/setup-miniconda
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
environment-name: openfe_env
cache-env: true
cache-downloads: true
extra-specs: |
python==${{ matrix.python-version }}
- name: "Install GUFE from main@HEAD"
run: python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main
- 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 openfe; print(openfe.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
- name: "Run tests"
env:
# Set the OFE_SLOW_TESTS to True if running a Cron job
OFE_SLOW_TESTS: ${{ fromJSON('{"false":"false","true":"true"}')[github.event_name != 'pull_request'] }}
run: |
pytest -n auto -v --cov=openfe --cov=openfecli --cov-report=xml
- name: codecov
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: False
verbose: True