-
Notifications
You must be signed in to change notification settings - Fork 4
172 lines (146 loc) · 5.55 KB
/
ci.yml
File metadata and controls
172 lines (146 loc) · 5.55 KB
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
name: CI
on:
pull_request:
push:
workflow_dispatch:
permissions:
contents: read
env:
ENV_NAME: aenet-torch
PYTHON_VERSION: "3.11"
TORCH_VERSION: "2.9.0"
PYG_WHEEL_URL: "https://data.pyg.org/whl/torch-2.9.0+cpu.html"
jobs:
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install project and dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -e ".[dev]"
micromamba run -n "${ENV_NAME}" python -m pip install "torch==${TORCH_VERSION}"
micromamba run -n "${ENV_NAME}" python -m pip install \
torch-scatter torch-cluster -f "${PYG_WHEEL_URL}"
- name: Run general pytest suite
run: |
micromamba run -n "${ENV_NAME}" \
pytest -q -m "not docs_examples" \
--ignore=src/aenet/mlip/tests
docs:
name: Docs
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install project and dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -e ".[dev]"
micromamba run -n "${ENV_NAME}" python -m pip install "torch==${TORCH_VERSION}"
micromamba run -n "${ENV_NAME}" python -m pip install \
torch-scatter torch-cluster -f "${PYG_WHEEL_URL}"
- name: Run pytest docs examples
run: |
micromamba run -n "${ENV_NAME}" pytest -q -m docs_examples
- name: Run Sphinx doctest
run: |
micromamba run -n "${ENV_NAME}" \
python -m sphinx -b doctest docs/source docs/build/doctest
- name: Run warning-clean Sphinx HTML build
run: |
micromamba run -n "${ENV_NAME}" \
python -m sphinx -W --keep-going -b html docs/source docs/build/html
readthedocs-smoke:
name: ReadTheDocs Smoke
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install ReadTheDocs-like dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -r docs/requirements.txt
micromamba run -n "${ENV_NAME}" python -m pip install -e .
- name: Run warning-clean Sphinx HTML build
run: |
micromamba run -n "${ENV_NAME}" \
python -m sphinx -W --keep-going -b html \
docs/source docs/build/readthedocs-html
notebooks:
name: Notebook (${{ matrix.notebook_name }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- notebook: notebooks/example-04-torch-featurization.ipynb
notebook_name: example-04-torch-featurization
- notebook: notebooks/example-05-torch-training.ipynb
notebook_name: example-05-torch-training
- notebook: notebooks/example-07-neighbor-list.ipynb
notebook_name: example-07-neighbor-list
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Set up micromamba environment
uses: mamba-org/setup-micromamba@v2
with:
environment-name: ${{ env.ENV_NAME }}
create-args: >-
python=${{ env.PYTHON_VERSION }}
pip
cache-environment: true
cache-downloads: true
init-shell: bash
- name: Install project and dependencies
run: |
micromamba run -n "${ENV_NAME}" python -m pip install --upgrade pip
micromamba run -n "${ENV_NAME}" python -m pip install -e ".[dev]"
micromamba run -n "${ENV_NAME}" python -m pip install "torch==${TORCH_VERSION}"
micromamba run -n "${ENV_NAME}" python -m pip install \
torch-scatter torch-cluster -f "${PYG_WHEEL_URL}"
- name: Prepare disposable notebook worktree
run: |
mkdir -p "${RUNNER_TEMP}/notebook-worktree"
rsync -a --delete --exclude ".git" ./ "${RUNNER_TEMP}/notebook-worktree/"
- name: Execute notebook
run: |
mkdir -p "${RUNNER_TEMP}/executed-notebooks"
micromamba run -n "${ENV_NAME}" \
python -m jupyter nbconvert --to notebook --execute \
"${RUNNER_TEMP}/notebook-worktree/${{ matrix.notebook }}" \
--output-dir "${RUNNER_TEMP}/executed-notebooks" \
--ExecutePreprocessor.timeout=600