-
Notifications
You must be signed in to change notification settings - Fork 26
216 lines (190 loc) · 6.33 KB
/
gh-ci-cron.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: GH Actions Cron CI
on:
push:
branches:
- main
schedule:
# once a week at midnight on Sunday
- cron: "0 3 * * 0"
concurrency:
# Commits to develop/master will cancel each other, but PRs will only cancel
# commits within the same PR
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
gen_matrix:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.get-mdakits.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: get-python
uses: actions/setup-python@v3
with:
python-version: 3.9
- id: get-mdakits
run: |
mdakit=$(python utils/get_dir_matrix.py)
echo "matrix=${mdakit}" >> $GITHUB_OUTPUT
mdakit-ci:
needs: gen_matrix
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
mdakit: ${{fromJSON(needs.gen_matrix.outputs.matrix)}}
jobstep: ['latest', 'develop']
steps:
- uses: actions/checkout@v3
- id: prev-python-ver
name: prev-python-ver
uses: MDAnalysis/get-latest-python-version@main
with:
last-n-minor-release: 1
- id: get-base-python-deps
name: get-base-python-deps
run: |
pip install requests setuptools packaging pyyaml pydantic PyGithub
- id: check-set-python-bounds
name: check-set-python-bounds
continue-on-error: true
run: |
basepy=${{steps.prev-python-ver.outputs.python-version}}
pyver=$(python utils/check_python_ver.py --mdakit "${{matrix.mdakit}}" --maxpyver ${basepy})
echo "PYVER=${pyver}" >> $GITHUB_ENV
- id: install-conda-env
name: install-conda-env
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ env.PYVER }}
add-pip-as-python-dependency: true
architecture: x64
use-mamba: true
miniforge-variant: Mambaforge
channels: conda-forge, defaults
channel-priority: flexible
auto-update-conda: true
show-channel-urls: true
- id: install-conda-base-deps
name: install-conda-base-deps
run: |
mamba install requests setuptools packaging pyyaml pydantic
pip install PyGithub
- id: install-mdakit
name: install-mdakit
continue-on-error: true
run: |
if [[ ${{ matrix.jobstep }} == "develop" ]]; then
type="src"
else
type="install"
fi
install=$(python utils/get_install.py --itype ${type} --mdakit ${{matrix.mdakit}})
echo "install=${install}"
eval ${install}
- id: install-test-deps
name: install-test-deps
continue-on-error: true
run: |
install=$(python utils/get_testdeps.py --mdakit ${{matrix.mdakit}})
echo "install tests:${install}"
eval ${install}
- id: install-mdanalysis
name: install-mdanalysis
uses: MDAnalysis/install-mdanalysis@main
continue-on-error: true
with:
version: ${{ matrix.jobstep }}
install-tests: true
installer: mamba
shell: bash -l {0}
- id: run-tests
name: run-tests
continue-on-error: true
run: |
tests=$(python utils/get_runtests.py --mdakit ${{matrix.mdakit}} --runtype ${{matrix.jobstep}})
echo "tests: ${tests}"
eval ${tests}
- id: store-errors
name: store-errors
run: |
echo "install_python=${{ steps.check-set-python-bounds.outcome }}" >> $GITHUB_ENV
echo "install_mdakit=${{ steps.install-mdakit.outcome }}" >> $GITHUB_ENV
echo "install_test_deps=${{ steps.install-test-deps.outcome }}" >> $GITHUB_ENV
echo "install_mdanalysis=${{ steps.install-mdanalysis.outcome }}" >> $GITHUB_ENV
echo "run_tests=${{ steps.run-tests.outcome }}" >> $GITHUB_ENV
- id: write-errors
name: write-errors
run: |
python utils/write-ci-status-json.py --tag ${{ matrix.jobstep }} --mdakit ${{ matrix.mdakit }}
- id: upload-artifacts
name: upload-artifacts
uses: actions/upload-artifact@v3
with:
name: cron-statuses-${{ matrix.mdakit }}-${{ matrix.jobstep }}
path: ${{ matrix.mdakit }}-${{ matrix.jobstep }}-statuses.json
retention-days: 1
if-no-files-found: error
process_results:
if: ${{ always() }}
needs: mdakit-ci
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
packages: none
issues: write
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: json-statuses/
- name: list-temp-files
run: ls -l json-statuses/*/
- id: get-base-python-deps
name: get-base-python-deps
run: |
pip install requests setuptools packaging pyyaml pydantic PyGithub
- id: combine-write-raise-issues
name: combine-write-raise-issues
run: |
python utils/handle-status.py
env:
GITHUB_TOKEN: ${{ github.token }}
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: commit changes to status files
skip_dirty_check: false
skip_fetch: false
deploy_docs:
if: ${{ always() }}
needs: process_results
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.9
auto-update-conda: true
channel-priority: flexible
channels: conda-forge
add-pip-as-python-dependency: true
architecture: x64
use-mamba: true
miniforge-variant: Mambaforge
environment-file: docs/requirements.yaml
- name: build_docs
run: |
cd docs && sphinx-build -b html source build
- name: deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build
cname: mdakits.mdanalysis.org
user_name: 'github-actions'
user_email: '[email protected]'