Use build.sh
This commit is contained in:
parent
9c7e203e90
commit
181a581db1
3 changed files with 18 additions and 58 deletions
51
.github/workflows/build.yml
vendored
51
.github/workflows/build.yml
vendored
|
|
@ -42,55 +42,18 @@ jobs:
|
||||||
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
|
||||||
run: |
|
run: |
|
||||||
source actions-ci/install.sh
|
source actions-ci/install.sh
|
||||||
- name: Pip install Sphinx, pre-commit
|
|
||||||
run: |
|
|
||||||
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit sphinx-autoapi
|
|
||||||
- name: Library version
|
- name: Library version
|
||||||
run: git describe --dirty --always --tags
|
run: git describe --dirty --always --tags
|
||||||
- name: Setup problem matchers
|
- name: Perform build & test
|
||||||
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
|
|
||||||
- name: Pre-commit hooks
|
|
||||||
run: |
|
run: |
|
||||||
pre-commit run --all-files
|
./build.sh
|
||||||
- name: Clone and build circuitpython unix port
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
[ -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)
|
|
||||||
[ -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)
|
|
||||||
[ -x circuitpython/ports/unix/micropython ] || (
|
|
||||||
make -C circuitpython/mpy-cross -j$(nproc)
|
|
||||||
make -C circuitpython/ports/unix -j$(nproc) deplibs
|
|
||||||
make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
|
|
||||||
)
|
|
||||||
- name: Unit Test
|
|
||||||
run: |
|
|
||||||
python -m jepler_udecimal.test
|
|
||||||
if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py -d examples; then
|
|
||||||
for exp in *.exp; do
|
|
||||||
testbase=$(basename $exp .exp);
|
|
||||||
echo -e "\nFAILURE $testbase";
|
|
||||||
diff -u $testbase.exp $testbase.out;
|
|
||||||
done
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Build assets
|
|
||||||
run: circuitpython-build-bundles --package_folder_prefix jepler --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
|
|
||||||
- name: Build docs
|
|
||||||
working-directory: docs
|
|
||||||
run: sphinx-build -E -W -b html . _build/html
|
|
||||||
- name: Archive bundles
|
- name: Archive bundles
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: bundles
|
name: bundles
|
||||||
path: ${{ github.workspace }}/bundles/
|
path: ${{ github.workspace }}/bundles/
|
||||||
- name: Check For setup.py
|
- name: Archive docs
|
||||||
id: need-pypi
|
uses: actions/upload-artifact@v2
|
||||||
run: |
|
with:
|
||||||
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
|
name: docs
|
||||||
- name: Build Python package
|
path: ${{ github.workspace }}/_build/html
|
||||||
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
|
|
||||||
run: |
|
|
||||||
pip install --upgrade setuptools wheel twine readme_renderer testresources
|
|
||||||
python setup.py sdist
|
|
||||||
python setup.py bdist_wheel --universal
|
|
||||||
twine check dist/*
|
|
||||||
|
|
|
||||||
23
build.sh
23
build.sh
|
|
@ -9,17 +9,12 @@ echo "=== Create and set up virtual environment"
|
||||||
. .env/bin/activate
|
. .env/bin/activate
|
||||||
echo "=== Install requirements"
|
echo "=== Install requirements"
|
||||||
pip3 install wheel
|
pip3 install wheel
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements_dev.txt
|
||||||
echo "=== Run pre-commit"
|
echo "=== Run pre-commit"
|
||||||
pre-commit run --all-files
|
pre-commit run --all-files
|
||||||
echo "=== Run pylint"
|
|
||||||
pylint jepler_udecimal
|
|
||||||
if [ -d examples ]; then
|
|
||||||
pylint --disable=missing-docstring,invalid-name,bad-whitespace examples
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "=== Clone and build circuitpython unix port"
|
echo "=== Clone and build circuitpython unix port"
|
||||||
[ -e circuitpython/py/py.mk ] || git clone --depth=1 https://github.com/adafruit/circuitpython
|
[ -e circuitpython/py/py.mk ] || git clone --shallow-since=2021-07-01 https://github.com/adafruit/circuitpython
|
||||||
[ -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)
|
[ -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)
|
||||||
[ -x circuitpython/ports/unix/micropython ] || (
|
[ -x circuitpython/ports/unix/micropython ] || (
|
||||||
make -C circuitpython/mpy-cross -j$(nproc)
|
make -C circuitpython/mpy-cross -j$(nproc)
|
||||||
|
|
@ -30,12 +25,14 @@ make -C circuitpython/ports/unix -j$(nproc) DEBUG=1 STRIP=:
|
||||||
echo "=== Run tests"
|
echo "=== Run tests"
|
||||||
python -m jepler_udecimal.test
|
python -m jepler_udecimal.test
|
||||||
|
|
||||||
if ! env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests -d examples; then
|
run-tests () {
|
||||||
for exp in *.exp; do
|
env MICROPYPATH=. PYTHONPATH=. MICROPY_MICROPYTHON=circuitpython/ports/unix/micropython circuitpython/tests/run-tests.py "$@"
|
||||||
testbase=$(basename $exp .exp);
|
}
|
||||||
echo -e "\nFAILURE $testbase";
|
|
||||||
diff -u $testbase.exp $testbase.out;
|
run-tests --clean-failures
|
||||||
done
|
if ! run-tests -d examples; then
|
||||||
|
run-tests --print-failures
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
|
PYTHONPATH=. python examples/test_udecimal.py > test_udecimal.exp
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
pre-commit
|
pre-commit
|
||||||
recommonmark==0.6.0
|
recommonmark==0.6.0
|
||||||
sphinx<4
|
sphinx
|
||||||
sphinx-autoapi
|
sphinx-autoapi
|
||||||
sphinxcontrib-svg2pdfconverter==0.1.0
|
sphinxcontrib-svg2pdfconverter==0.1.0
|
||||||
sphinx-rtd-theme
|
sphinx-rtd-theme
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue