-
Notifications
You must be signed in to change notification settings - Fork 21
135 lines (120 loc) · 4.03 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: "CI"
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
# At 07:00 UTC on Monday and Thursday.
- cron: "0 7 * * *"
workflow_dispatch:
release:
types:
- published
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
tests:
runs-on: ${{ matrix.os }}-latest
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }} 🗃️${{ matrix.pydantic-version }} oechem: ${{ matrix.openeye }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu"]
pydantic-version: [">1"]
python-version:
- "3.9"
- "3.10"
- "3.11"
openeye: ["no"]
include:
- os: "macos"
python-version: "3.11"
pydantic-version: ">1"
- os: "ubuntu"
python-version: "3.11"
pydantic-version: "<2"
- os: "ubuntu"
python-version: "3.11"
pydantic-version: ">1"
openeye: "yes"
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- name: "Setup Micromamba"
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: openfe_env
cache-environment: true
cache-downloads: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=${{ matrix.python-version }}
pydantic=${{ matrix.pydantic-version }}
init-shell: bash
- name: "Install OpenEye"
if: ${{ !github.event.pull_request.head.repo.fork
&& matrix.openeye == 'yes' }}
env:
OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }}
run: |
echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE}
micromamba install -c openeye openeye-toolkits
python -c "import openeye; assert openeye.oechem.OEChemIsLicensed(), 'oechem license check failed!'"
- name: "Install GUFE from main@HEAD"
run: python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main
- 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 openfe; print(openfe.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
- name: "Run tests"
env:
# Set the OFE_SLOW_TESTS to True if running a Cron job
OFE_SLOW_TESTS: ${{ fromJSON('{"false":"false","true":"true"}')[github.event_name != 'pull_request'] }}
DUECREDIT_ENABLE: 'yes'
run: |
pytest -n auto -v --cov=openfe --cov=openfecli --cov-report=xml --durations=10
- name: codecov-pr
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: False
verbose: True
flags: fast-tests
- name: codecov-merge
# we only want to upload a slow report if
# 1) it isn't a schedule run
# 2) it wasn't from a PR (we don't run slow tests on PRs)
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name != 'schedule'
&& github.event_name != 'pull_request' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: False
verbose: True
flags: slow-tests