Skip to content

Commit 181a581

Browse files
committed
Use build.sh
1 parent 9c7e203 commit 181a581

File tree

3 files changed

+18
-58
lines changed

3 files changed

+18
-58
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -42,55 +42,18 @@ jobs:
4242
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
4343
run: |
4444
source actions-ci/install.sh
45-
- name: Pip install Sphinx, pre-commit
46-
run: |
47-
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit sphinx-autoapi
4845
- name: Library version
4946
run: git describe --dirty --always --tags
50-
- name: Setup problem matchers
51-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
52-
- name: Pre-commit hooks
53-
run: |
54-
pre-commit run --all-files
55-
- name: Clone and build circuitpython unix port
56-
run: |
57-
set -e
58-
[ -e circuitpython/py/py.mk ] || (git clone --depth=1 https://github.com/adafruit/circuitpython && cd circuitpython && git fetch --tags --recurse-submodules=no --shallow-since="2021-07-01" https://github.com/adafruit/circuitpython HEAD)
59-
[ -e circuitpython/lib/libffi/autogen.sh ] || (cd circuitpython && git submodule update --init lib/libffi lib/axtls lib/berkeley-db-1.xx tools/huffman lib/uzlib extmod/ulab)
60-
[ -x circuitpython/ports/unix/micropython ] || (
61-
make -C circuitpython/mpy-cross -j$(nproc)
62-
make -C circuitpython/ports/unix -j$(nproc) deplibs
63-
make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
64-
)
65-
- name: Unit Test
47+
- name: Perform build & test
6648
run: |
67-
python -m jepler_udecimal.test
68-
if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py -d examples; then
69-
for exp in *.exp; do
70-
testbase=$(basename $exp .exp);
71-
echo -e "\nFAILURE $testbase";
72-
diff -u $testbase.exp $testbase.out;
73-
done
74-
exit 1
75-
fi
76-
- name: Build assets
77-
run: circuitpython-build-bundles --package_folder_prefix jepler --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
78-
- name: Build docs
79-
working-directory: docs
80-
run: sphinx-build -E -W -b html . _build/html
49+
./build.sh
8150
- name: Archive bundles
8251
uses: actions/upload-artifact@v2
8352
with:
8453
name: bundles
8554
path: ${{ github.workspace }}/bundles/
86-
- name: Check For setup.py
87-
id: need-pypi
88-
run: |
89-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
90-
- name: Build Python package
91-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
92-
run: |
93-
pip install --upgrade setuptools wheel twine readme_renderer testresources
94-
python setup.py sdist
95-
python setup.py bdist_wheel --universal
96-
twine check dist/*
55+
- name: Archive docs
56+
uses: actions/upload-artifact@v2
57+
with:
58+
name: docs
59+
path: ${{ github.workspace }}/_build/html

build.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ echo "=== Create and set up virtual environment"
99
. .env/bin/activate
1010
echo "=== Install requirements"
1111
pip3 install wheel
12-
pip3 install -r requirements.txt
12+
pip3 install -r requirements_dev.txt
1313
echo "=== Run pre-commit"
1414
pre-commit run --all-files
15-
echo "=== Run pylint"
16-
pylint jepler_udecimal
17-
if [ -d examples ]; then
18-
pylint --disable=missing-docstring,invalid-name,bad-whitespace examples
19-
fi
2015

2116
echo "=== Clone and build circuitpython unix port"
22-
[ -e circuitpython/py/py.mk ] || git clone --depth=1 https://github.com/adafruit/circuitpython
17+
[ -e circuitpython/py/py.mk ] || git clone --shallow-since=2021-07-01 https://github.com/adafruit/circuitpython
2318
[ -e circuitpython/lib/libffi/autogen.sh ] || (cd circuitpython && git submodule update --init lib/libffi lib/axtls lib/berkeley-db-1.xx tools/huffman lib/uzlib extmod/ulab)
2419
[ -x circuitpython/ports/unix/micropython ] || (
2520
make -C circuitpython/mpy-cross -j$(nproc)
@@ -30,12 +25,14 @@ make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
3025
echo "=== Run tests"
3126
python -m jepler_udecimal.test
3227

33-
if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests -d examples; then
34-
for exp in *.exp; do
35-
testbase=$(basename $exp .exp);
36-
echo -e "\nFAILURE $testbase";
37-
diff -u $testbase.exp $testbase.out;
38-
done
28+
run-tests () {
29+
env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py "$@"
30+
}
31+
32+
run-tests --clean-failures
33+
if ! run-tests -d examples; then
34+
run-tests --print-failures
35+
exit 1
3936
fi
4037

4138
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp

requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: MIT
55
pre-commit
66
recommonmark==0.6.0
7-
sphinx<4
7+
sphinx
88
sphinx-autoapi
99
sphinxcontrib-svg2pdfconverter==0.1.0
1010
sphinx-rtd-theme

0 commit comments

Comments
 (0)