Skip to content

Commit 58eda2e

Browse files
authored
Merge pull request adafruit#5350 from microDev1/ci-docs-split
CI: Build docs dynamically
2 parents 8e63a2e + be3fca8 commit 58eda2e

File tree

8 files changed

+256
-187
lines changed

8 files changed

+256
-187
lines changed

.github/workflows/build.yml

Lines changed: 101 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,23 @@ jobs:
1616
test:
1717
runs-on: ubuntu-20.04
1818
outputs:
19-
arm-boards: ${{ steps.set-matrix.outputs.arm-boards }}
20-
riscv-boards: ${{ steps.set-matrix.outputs.riscv-boards }}
21-
espressif-boards: ${{ steps.set-matrix.outputs.espressif-boards }}
19+
build-doc: ${{ steps.set-matrix.outputs.build-doc }}
20+
boards-arm: ${{ steps.set-matrix.outputs.boards-arm }}
21+
boards-riscv: ${{ steps.set-matrix.outputs.boards-riscv }}
22+
boards-espressif: ${{ steps.set-matrix.outputs.boards-espressif }}
2223
steps:
2324
- name: Dump GitHub context
2425
env:
2526
GITHUB_CONTEXT: ${{ toJson(github) }}
2627
run: echo "$GITHUB_CONTEXT"
2728
- uses: actions/checkout@v2.2.0
2829
with:
29-
submodules: true
30+
submodules: false
3031
fetch-depth: 0
31-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
32+
- name: Populate selected submodules
33+
run: git submodule update --init extmod/ lib/ tools/
34+
- name: Fetch tags
35+
run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
3236
- name: CircuitPython version
3337
run: |
3438
git describe --dirty --tags
@@ -37,41 +41,18 @@ jobs:
3741
uses: actions/setup-python@v1
3842
with:
3943
python-version: 3.8
40-
- name: Install deps
44+
- name: Install dependencies
4145
run: |
4246
sudo apt-get update
4347
sudo apt-get install -y eatmydata
44-
sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra gcc-aarch64-linux-gnu
45-
pip install -r requirements-dev.txt
48+
sudo eatmydata apt-get install -y gettext gcc-aarch64-linux-gnu mingw-w64
49+
pip install -r requirements-ci.txt -r requirements-dev.txt
4650
- name: Versions
4751
run: |
4852
gcc --version
4953
python3 --version
5054
- name: Duplicate USB VID/PID Check
5155
run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
52-
- name: Build and Validate Stubs
53-
run: make check-stubs -j2
54-
- uses: actions/upload-artifact@v2
55-
with:
56-
name: stubs
57-
path: circuitpython-stubs/dist/*
58-
- name: Install pypi dependencies
59-
run: |
60-
python -m pip install --upgrade pip
61-
pip install setuptools wheel twine
62-
- name: Test Documentation Build (HTML)
63-
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
64-
- uses: actions/upload-artifact@v2
65-
with:
66-
name: docs
67-
path: _build/html
68-
- name: Test Documentation Build (LaTeX/PDF)
69-
run: |
70-
make latexpdf
71-
- uses: actions/upload-artifact@v2
72-
with:
73-
name: docs
74-
path: _build/latex
7556
- name: Build mpy-cross
7657
run: make -C mpy-cross -j2
7758
- name: Build unix port
@@ -130,39 +111,22 @@ jobs:
130111
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static.exe s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-x64-windows-${{ env.CP_VERSION }}.exe --no-progress --region us-east-1
131112
zip -9r circuitpython-stubs.zip circuitpython-stubs
132113
[ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs/dist/*.tar.gz s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1
133-
134-
- name: Upload stubs to PyPi
135-
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit'
136-
env:
137-
TWINE_USERNAME: ${{ secrets.pypi_username }}
138-
TWINE_PASSWORD: ${{ secrets.pypi_password }}
139-
run: |
140-
# setup.py sdist was run by 'make stubs'
141-
[ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi"
142-
[ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/*
143-
- uses: dorny/paths-filter@v2
114+
- name: "Get changes"
115+
if: github.event_name == 'pull_request'
116+
uses: dorny/paths-filter@v2
144117
id: filter
145118
with:
146-
# Enable listing of files matching each filter.
147-
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
148-
# Paths will be formatted as JSON array
149119
list-files: json
150-
151-
# Compare against this branch. (Ignored for PRs.)
152-
base: ${{ github.ref }}
153-
154-
# In this example all changed files are passed to the following action to do
155-
# some custom processing.
156120
filters: |
157121
changed:
158122
- '**'
159-
- name: "Set boards to build"
123+
- name: "Set matrix"
160124
id: set-matrix
161125
working-directory: tools
162126
env:
163127
CHANGED_FILES: ${{ steps.filter.outputs.changed_files }}
164-
run: |
165-
python3 -u ci_changed_board_list.py
128+
run: python3 -u ci_set_matrix.py
129+
166130

167131
mpy-cross-mac:
168132
runs-on: macos-10.15
@@ -173,9 +137,12 @@ jobs:
173137
run: echo "$GITHUB_CONTEXT"
174138
- uses: actions/checkout@v2.2.0
175139
with:
176-
submodules: true
140+
submodules: false
177141
fetch-depth: 0
178-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
142+
- name: Populate selected submodules
143+
run: git submodule update --init extmod/ lib/ tools/
144+
- name: Fetch tags
145+
run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
179146
- name: CircuitPython version
180147
run: |
181148
git describe --dirty --tags
@@ -221,15 +188,71 @@ jobs:
221188
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
222189

223190

191+
build-doc:
192+
runs-on: ubuntu-20.04
193+
needs: test
194+
if: ${{ needs.test.outputs.build-doc == 'True' }}
195+
steps:
196+
- uses: actions/checkout@v2.2.0
197+
with:
198+
submodules: false
199+
fetch-depth: 0
200+
- name: Populate selected submodules
201+
run: git submodule update --init extmod/
202+
- name: Fetch tags
203+
run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
204+
- name: CircuitPython version
205+
run: |
206+
git describe --dirty --tags
207+
echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
208+
- name: Set up Python 3.8
209+
uses: actions/setup-python@v1
210+
with:
211+
python-version: 3.8
212+
- name: Install dependencies
213+
run: |
214+
sudo apt-get update
215+
sudo apt-get install -y eatmydata
216+
sudo eatmydata apt-get install -y latexmk librsvg2-bin texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
217+
pip install -r requirements-ci.txt -r requirements-doc.txt
218+
- name: Build and Validate Stubs
219+
run: make check-stubs -j2
220+
- uses: actions/upload-artifact@v2
221+
with:
222+
name: stubs
223+
path: circuitpython-stubs/dist/*
224+
- name: Test Documentation Build (HTML)
225+
run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
226+
- uses: actions/upload-artifact@v2
227+
with:
228+
name: docs
229+
path: _build/html
230+
- name: Test Documentation Build (LaTeX/PDF)
231+
run: |
232+
make latexpdf
233+
- uses: actions/upload-artifact@v2
234+
with:
235+
name: docs
236+
path: _build/latex
237+
- name: Upload stubs to PyPi
238+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit'
239+
env:
240+
TWINE_USERNAME: ${{ secrets.pypi_username }}
241+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
242+
run: |
243+
# setup.py sdist was run by 'make stubs'
244+
[ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi"
245+
[ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/*
246+
247+
224248
build-arm:
225249
runs-on: ubuntu-20.04
226250
needs: test
227251
strategy:
228252
fail-fast: false
229253
matrix:
230-
board: ${{ fromJSON(needs.test.outputs.arm-boards) }}
231-
if: ${{ needs.test.outputs.arm-boards != '[]' }}
232-
254+
board: ${{ fromJSON(needs.test.outputs.boards-arm) }}
255+
if: ${{ needs.test.outputs.boards-arm != '[]' }}
233256
steps:
234257
- name: Set up Python 3.8
235258
uses: actions/setup-python@v1
@@ -239,11 +262,12 @@ jobs:
239262
with:
240263
submodules: true
241264
fetch-depth: 0
242-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
243-
- name: Install deps
265+
- name: Fetch tags
266+
run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
267+
- name: Install dependencies
244268
run: |
245269
sudo apt-get install -y gettext
246-
pip install -r requirements-dev.txt
270+
pip install -r requirements-ci.txt -r requirements-dev.txt
247271
wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
248272
sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
249273
- name: Versions
@@ -272,15 +296,15 @@ jobs:
272296
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
273297
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
274298

299+
275300
build-riscv:
276301
runs-on: ubuntu-20.04
277302
needs: test
278303
strategy:
279304
fail-fast: false
280305
matrix:
281-
board: ${{ fromJSON(needs.test.outputs.riscv-boards) }}
282-
if: ${{ needs.test.outputs.riscv-boards != '[]' }}
283-
306+
board: ${{ fromJSON(needs.test.outputs.boards-riscv) }}
307+
if: ${{ needs.test.outputs.boards-riscv != '[]' }}
284308
steps:
285309
- name: Set up Python 3.8
286310
uses: actions/setup-python@v1
@@ -290,11 +314,12 @@ jobs:
290314
with:
291315
submodules: true
292316
fetch-depth: 0
293-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
294-
- name: Install deps
317+
- name: Fetch tags
318+
run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
319+
- name: Install dependencies
295320
run: |
296321
sudo apt-get install -y gettext
297-
pip install -r requirements-dev.txt
322+
pip install -r requirements-ci.txt -r requirements-dev.txt
298323
wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz
299324
sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz
300325
- name: Versions
@@ -322,15 +347,16 @@ jobs:
322347
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
323348
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
324349
if: (github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'adafruit') || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
350+
351+
325352
build-espressif:
326353
runs-on: ubuntu-20.04
327354
needs: test
328355
strategy:
329356
fail-fast: false
330357
matrix:
331-
board: ${{ fromJSON(needs.test.outputs.espressif-boards) }}
332-
if: ${{ needs.test.outputs.espressif-boards != '[]' }}
333-
358+
board: ${{ fromJSON(needs.test.outputs.boards-espressif) }}
359+
if: ${{ needs.test.outputs.boards-espressif != '[]' }}
334360
steps:
335361
- name: Set up Python 3.8
336362
uses: actions/setup-python@v1
@@ -340,7 +366,8 @@ jobs:
340366
with:
341367
submodules: true
342368
fetch-depth: 0
343-
- run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
369+
- name: Fetch tags
370+
run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
344371
- name: CircuitPython version
345372
run: git describe --dirty --tags
346373
- uses: actions/cache@v2
@@ -363,11 +390,11 @@ jobs:
363390
env:
364391
IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf
365392
IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
366-
- name: Install CircuitPython deps
393+
- name: Install dependencies
367394
run: |
368395
source $IDF_PATH/export.sh
369-
pip install -r requirements-dev.txt
370396
sudo apt-get install -y gettext ninja-build
397+
pip install -r requirements-ci.txt -r requirements-dev.txt
371398
env:
372399
IDF_PATH: ${{ github.workspace }}/ports/espressif/esp-idf
373400
IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ stubs:
260260
@$(PYTHON) tools/extract_pyi.py shared-bindings/ $(STUBDIR)
261261
@$(PYTHON) tools/extract_pyi.py extmod/ulab/code/ $(STUBDIR)/ulab
262262
@$(PYTHON) tools/extract_pyi.py ports/atmel-samd/bindings $(STUBDIR)
263+
@$(PYTHON) tools/extract_pyi.py ports/espressif/bindings $(STUBDIR)
263264
@$(PYTHON) tools/extract_pyi.py ports/raspberrypi/bindings $(STUBDIR)
264265
@cp setup.py-stubs circuitpython-stubs/setup.py
265266
@cp README.rst-stubs circuitpython-stubs/README.rst
@@ -268,7 +269,7 @@ stubs:
268269

269270
.PHONY: check-stubs
270271
check-stubs: stubs
271-
@(cd $(STUBDIR) && set -- */__init__.pyi && mypy --strict "$${@%/*}")
272+
@(cd $(STUBDIR) && set -- */__init__.pyi && mypy "$${@%/*}")
272273
@tools/test-stubs.sh
273274

274275
update-frozen-libraries:

ports/espressif/bindings/espidf/__init__.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ const mp_obj_type_t mp_type_espidf_IDFError = {
110110
};
111111

112112

113-
//| class MemoryError(MemoryError):
113+
//| import builtins
114+
//| class MemoryError(builtins.MemoryError):
114115
//| """Raised when an ESP IDF memory allocation fails."""
115116
//| ...
116117
//|

requirements-ci.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# For uploading artifacts
2+
awscli

requirements-dev.txt

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,18 @@ cascadetoml
66
jinja2
77
typer
88

9-
requests
10-
requests-cache
119
sh
1210
click
13-
setuptools
1411
cpp-coveralls
15-
16-
# For docs
17-
Sphinx<4
18-
sphinx-rtd-theme
19-
myst-parser
20-
sphinx-autoapi
21-
sphinxcontrib-svg2pdfconverter
22-
readthedocs-sphinx-search
12+
requests
13+
requests-cache
2314

2415
# For translate check
2516
polib
2617

2718
# For pre-commit
2819
pyyaml
29-
astroid
30-
isort
3120
black
32-
mypy
33-
34-
# For uploading artifacts
35-
awscli
3621

3722
# for combining the Nordic SoftDevice with CircuitPython
3823
intelhex

requirements-doc.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# For docs
2+
mypy
3+
black
4+
isort
5+
twine
6+
wheel
7+
astroid
8+
setuptools
9+
10+
# For sphinx
11+
Sphinx<4
12+
sphinx-autoapi
13+
sphinx-rtd-theme
14+
sphinxcontrib-svg2pdfconverter
15+
readthedocs-sphinx-search
16+
myst-parser

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy