-
Notifications
You must be signed in to change notification settings - Fork 9
122 lines (101 loc) · 3 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
name: "CI"
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
# At 07:00 UTC on Monday and Thursday.
- cron: "0 7 * * *"
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
tests:
runs-on: ${{ matrix.OS }}-latest
name: "tests"
strategy:
fail-fast: false
matrix:
os: ['ubuntu', 'macos']
python-version:
- 3.9
env:
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
# More info on options: https://github.com/conda-incubator/setup-miniconda
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
environment-name: gufe
cache-env: true
cache-downloads: true
extra-specs: |
python==${{ matrix.python-version }}
- 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 gufe; print(gufe.__version__)"
- name: "Environment Information"
run: |
micromamba info
micromamba list
- name: "Run tests"
run: |
pytest -n 2 -v --cov=gufe --cov-report=xml
- name: codecov
if: ${{ github.repository == 'OpenFreeEnergy/gufe'
&& github.event != 'schedule' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: False
verbose: True
package_build_and_test:
runs-on: ubuntu-latest
name: "package build and install test"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: environment.yml
environment-name: gufe
cache-env: true
cache-downloads: true
extra-specs: |
python==${{ matrix.python-version }}
- name: "install extra deps"
run: pip install pipx wheel twine readme-renderer
- name: "build sdist"
run: pipx run build --sdist --outdir dist
- name: "check package build"
run: |
dist=$(ls -t1 dist/gufe-*tar.gz | head -n1)
test -n "${dist}" || { echo "no distribution found"; exit 1; }
twine check $dist
- name: "install from source dist"
working-directory: ./dist
run: python -m pip install gufe-*tar.gz
- name: "install checks"
working-directory: ./dist
run: |
pip check
python -Ic "import gufe; print(gufe.__version__)"
- name: "run tests"
working-directory: ./dist
run: pytest -n auto --pyargs gufe