Skip to content

CI

CI #743

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 * * *"
workflow_dispatch:
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.bespokefit }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-22.04", "macos-latest"]
bespokefit: ["true", "false"]
python-version:
- "3.11"
steps:
- uses: actions/checkout@v4
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v2
with:
environment-file: conda-envs/${{ matrix.os }}-bespokefit-${{ matrix.bespokefit}}.yaml
environment-name: openpharmflow
cache-environment: true
cache-downloads: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
nbval
pytest
pytest-cov
pytest-xdist
python=${{ matrix.python-version }}
packmol==21.0.4
init-shell: bash
- name: "Install"
run: python -m pip install --no-deps -e .
- name: "Environment Information"
run: |
micromamba info
micromamba list
- name: "Run tests"
run: pytest -n logical --nbval-lax --nbval-cell-timeout=3000 --dist loadscope -v --cov=openpharmmdflow --cov-report=xml --junitxml=junit.xml -o junit_family=legacy --durations=10
- name: codecov
if: ${{ github.repository == 'omsf/OpenPharmMDFlow' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: False
verbose: True
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}