Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 48 additions & 56 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,76 +11,68 @@ on:
jobs:
pre-commit:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run pre-commit
uses: pre-commit/action@v3.0.1
- uses: actions/checkout@v4
- uses: pre-commit/action@v3.0.1

test-matrix:
name: Test (${{ matrix.os }}, ${{ matrix.base }}-py${{ matrix.python-version }})
needs: pre-commit
runs-on: ${{ matrix.os }}

env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
PIXI_ENV: ${{ matrix.base }}-py${{ matrix.python-version }}

needs: pre-commit
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
pixi-environment: [default, pydantic-1-cpu, ambertools, openeye]
fail-fast: false

runs-on: ${{ matrix.os }}
python-version: ["311", "312"]
# Exclude the CUDA envs as we can't test them on GitHub Actions
base:
- openeye-fe-examples-cpu
- ambertools-fe-examples-cpu
- openeye-cpu
- ambertools-examples-pydantic-1-cpu

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Make oe_license.txt file from GH org secret "OE_LICENSE"
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}

- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.62.2
cache: true
# we use locked installs on macos-latest
# to avoid cross-platform resolution issues with cuda
locked: false
environments: ${{ matrix.pixi-environment }}

- name: Run tests
run: |
pixi run --environment ${{ matrix.pixi-environment }} test

- name: Test examples (default environment only)
if: matrix.pixi-environment == 'default'
run: |
pixi run --environment ${{ matrix.pixi-environment }} test-examples

- name: Build docs (default environment only)
if: matrix.pixi-environment == 'default'
run: |
pixi run --environment ${{ matrix.pixi-environment }} docs

- name: CodeCov
uses: codecov/codecov-action@v4.1.1
with:
file: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/checkout@v4

- name: Write OE license file
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: echo "${OE_LICENSE_TEXT}" > "${OE_LICENSE}"

- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.9.3
with:
pixi-version: v0.63.2
cache: true
environments: ${{ env.PIXI_ENV }}

- name: Run tests
run: pixi run -e "${{ env.PIXI_ENV }}" test

- name: Test examples
if: contains(env.PIXI_ENV, 'examples')
run: pixi run -e "${{ env.PIXI_ENV }}" test-examples

- name: CodeCov
uses: codecov/codecov-action@v5
with:
file: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

test:
needs: test-matrix
runs-on: ubuntu-latest
if: always()

steps:
- name: Check test matrix result
run: |
if [[ "${{ needs.test-matrix.result }}" != "success" ]]; then
echo "One or more test matrix jobs failed or were cancelled."
exit 1
fi
- name: Check test matrix result
run: |
if [[ "${{ needs.test-matrix.result }}" != "success" ]]; then
echo "One or more test matrix jobs failed or were cancelled."
exit 1
fi
Loading
Loading