Skip to content

Commit

Permalink
Merge pull request #32 from OpenFreeEnergy/fix-ci
Browse files Browse the repository at this point in the history
Spruce up CI
  • Loading branch information
IAlibay authored Jul 29, 2024
2 parents 75bd87f + a7fc383 commit 484938b
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,33 @@ on:
push:
branches:
- main
release:
types:
- published
schedule:
# At 07:00 UTC on Monday and Thursday.
- cron: "0 7 * * *"
workflow_dispatch:

defaults:
run:
shell: bash -l {0}
shell: bash -leo pipefail {0}

jobs:
tests:
runs-on: ${{ matrix.os}}-latest
runs-on: ${{ matrix.os}}
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos"]
os: ["ubuntu-latest", "macos-latest", "macos-13"]
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
Expand All @@ -38,33 +43,39 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}
init-shell: bash

- name: "Install"
run: |
python -m pip install --no-deps .
- name: "Restore pooch test data cache"
id: cache-testdata-restore
uses: actions/cache/restore@v3
with:
path: |
~/.cache/openfe_analysis/
key: ${{ runner.os }}

- name: "Test imports"
run: |
python -Ic "import openfe_analysis; print(openfe_analysis.__version__)"
- name: "Run tests"
run: |
pytest -n 1 -v --cov=openfe_analysis --cov-report=xml --durations=10
pytest -n auto -v --cov=openfe_analysis --cov-report=xml --durations=10
- name: "Save pooch test data cache"
id: cache-testdata-save
uses: actions/cache/save@v3
with:
path: |
~/.cache/openfe_analysis/
key: ${{ runner.os }}

- name: codecov
if: ${{ github.repository == 'OpenFreeEnergy/openfe_analysis'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand Down

0 comments on commit 484938b

Please sign in to comment.