Skip to content

CI

CI #3838

Workflow file for this run

name: "CI"
on:
# Allow for workflows to be manuallly triggered
workflow_dispatch:
pull_request:
push:
branches:
- main
- stable
- release
schedule:
# At 07:00 UTC on Monday and Thursday.
- cron: "0 7 * * *"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
tests:
runs-on: ${{ matrix.OS }}
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }} 🎨-${{ matrix.py3Dmol }}"
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', macos-latest]
py3Dmol: ["no"]
python-version:
- "3.11"
- "3.12"
- "3.13"
include:
- os: "ubuntu-latest"
python-version: "3.12"
py3Dmol: "yes"
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v2
with:
micromamba-binary-path: ~/.local/bin/micromamba
environment-file: environment.yml
environment-name: gufe
cache-environment: true
cache-downloads: true
create-args: >-
python=${{ matrix.python-version }}
init-shell: bash
- name: "Install py3Dmol (optional)"
if: ${{ matrix.py3Dmol == 'yes' }}
run: micromamba install py3Dmol
- 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 gufe; print(gufe.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
- name: Cache Pooch data
uses: actions/cache@v5
with:
path: |
# linux cache location
~/.cache/gufe
# osx cache location
~/Library/Caches/gufe
# When files are added or changed in a pooch registry
# bump this key to create a new cache, for example if
# the key is pooch-${{ matrix.os }}-1 change it to pooch-${{ matrix.os }}-2
key: pooch-${{ matrix.os }}-0
- name: "Run tests"
run: |
pytest -n 2 -v --cov=gufe --cov-report=xml
- name: codecov
if: ${{ github.repository == 'OpenFreeEnergy/gufe'
&& github.event != 'schedule' }}
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: False
verbose: True
package_build_and_test:
runs-on: ubuntu-latest
name: "package build and install test"
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
environment-name: gufe
cache-environment: true
cache-downloads: true
create-args: >-
python=3.12
init-shell: bash
- name: "install extra deps"
run: pip install pipx wheel twine readme-renderer
- name: "build sdist"
run: pipx run build --sdist --outdir dist
- name: "check package build"
run: |
dist=$(ls -t1 dist/gufe-*tar.gz | head -n1)
test -n "${dist}" || { echo "no distribution found"; exit 1; }
twine check $dist
- name: "install from source dist"
working-directory: ./dist
run: python -m pip install gufe-*tar.gz
- name: "install checks"
working-directory: ./dist
run: |
python -Ic "import gufe; print(gufe.__version__)"
- name: "run tests"
working-directory: ./dist
run: pytest -n auto --pyargs gufe