-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (74 loc) · 2.06 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: "CI"
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
# At 07:00 UTC on Monday and Thursday.
- cron: "0 7 * * *"
workflow_dispatch:
defaults:
run:
shell: bash -leo pipefail {0}
jobs:
tests:
runs-on: ${{ matrix.os}}
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }}"
strategy:
fail-fast: false
matrix:
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:
environment-file: environment.yml
environment-name: openfe_analysis_env
cache-environment: true
cache-downloads: true
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 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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: false
verbose: true