-
Notifications
You must be signed in to change notification settings - Fork 26
131 lines (115 loc) · 3.75 KB
/
gh-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
name: GH Actions CI
on:
pull_request:
branches:
- main
# 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-changed-mdakits.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- id: get-python
uses: actions/setup-python@v3
with:
python-version: 3.9
- id: files
name: get changed filed
uses: masesgroup/retrieve-changed-files@v3
with:
format: 'json'
- id: get-changed-mdakits
name: build mdakit matrix
run: |
echo ${{ steps.files.outputs.all }}
mdakit=$(python utils/get_affected_mdakits.py --json '${{ steps.files.outputs.all }}')
echo ${mdakit}
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: false
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: false
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: false
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: false
with:
version: ${{ matrix.jobstep }}
install-tests: true
installer: mamba
shell: bash -l {0}
- id: run-tests
name: run-tests
continue-on-error: false
run: |
tests=$(python utils/get_runtests.py --mdakit ${{matrix.mdakit}} --runtype ${{matrix.jobstep}})
echo "tests: ${tests}"
eval ${tests}