Skip to content

Commit

Permalink
use already built mpy-cross
Browse files Browse the repository at this point in the history
  • Loading branch information
microdev1 committed Feb 10, 2023
1 parent e3b924b commit baaa236
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 33 deletions.
83 changes: 55 additions & 28 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ jobs:
runs-on: ubuntu-20.04
outputs:
build-doc: ${{ steps.set-matrix.outputs.build-doc }}
build-boards: ${{ steps.set-matrix.outputs.build-boards }}
boards-aarch: ${{ steps.set-matrix.outputs.boards-aarch }}
boards-arm: ${{ steps.set-matrix.outputs.boards-arm }}
boards-espressif: ${{ steps.set-matrix.outputs.boards-espressif }}
boards-riscv: ${{ steps.set-matrix.outputs.boards-riscv }}
cp-version: ${{ steps.set-up-submodules.outputs.version }}
env:
MICROPY_CPYTHON3: python3.8
MICROPY_MICROPYTHON: ${{ github.workspace }}/ports/unix/micropython-coverage
steps:
- name: Dump GitHub context
run: echo "$GITHUB_CONTEXT"
Expand All @@ -39,14 +43,14 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: 3.x
- name: Duplicate USB VID/PID check
run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
- name: Set up submodules
id: set-up-submodules
uses: ./.github/actions/fetch_submodules
with:
cache: "cache"
cache: cache
version: true
- name: Install dependencies
run: |
Expand All @@ -60,24 +64,27 @@ jobs:
python3 --version
- name: Build mpy-cross
run: make -C mpy-cross -j2
- uses: actions/upload-artifact@v3
with:
name: mpy-cross
path: mpy-cross/mpy-cross
- name: Build unix port
run: |
make -C ports/unix VARIANT=coverage -j2
run: make -C ports/unix VARIANT=coverage -j2
- name: Test all
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1
run: ./run-tests.py -j2
working-directory: tests
- name: Print failure info
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --print-failures
run: ./run-tests.py -j2 --print-failures
if: failure()
working-directory: tests
- name: Native Tests
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --emit native
run: ./run-tests.py -j2 --emit native
working-directory: tests
- name: mpy Tests
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --via-mpy -d basics float micropython
run: ./run-tests.py -j2 --via-mpy -d basics float micropython
working-directory: tests
- name: Native mpy Tests
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --via-mpy --emit native -d basics float micropython
run: ./run-tests.py -j2 --via-mpy --emit native -d basics float micropython
working-directory: tests
- name: Build native modules
run: |
Expand All @@ -90,7 +97,7 @@ jobs:
make -C examples/natmod/ure
make -C examples/natmod/uzlib
- name: Test native modules
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py
run: ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py
working-directory: tests
- name: Build mpy-cross.static-aarch64
run: make -C mpy-cross -j2 -f Makefile.static-aarch64
Expand Down Expand Up @@ -166,11 +173,7 @@ jobs:
mpy-cross-mac:
runs-on: macos-11
needs: test
if: >-
needs.test.outputs.boards-aarch != '[]' ||
needs.test.outputs.boards-arm != '[]' ||
needs.test.outputs.boards-espressif != '[]' ||
needs.test.outputs.boards-riscv != '[]'
if: ${{ needs.test.outputs.build-boards == 'True' }}
env:
CP_VERSION: ${{ needs.test.outputs.cp-version }}
steps:
Expand All @@ -182,7 +185,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: 3.x
- name: Set up submodules
uses: ./.github/actions/fetch_submodules
- name: Versions
Expand Down Expand Up @@ -235,7 +238,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: 3.x
- name: Set up submodules
uses: ./.github/actions/fetch_submodules
- name: Install dependencies
Expand Down Expand Up @@ -305,7 +308,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: 3.x
- name: Set up submodules
id: set-up-submodules
uses: ./.github/actions/fetch_submodules
Expand Down Expand Up @@ -334,9 +337,15 @@ jobs:
arm-none-eabi-gcc --version
python3 --version
mkfs.fat --version || true
- name: Build mpy-cross
- name: Download mpy-cross
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: make -C mpy-cross -j2
uses: actions/download-artifact@v3
with:
name: mpy-cross
path: mpy-cross
- name: Make mpy-cross executable
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: sudo chmod +x mpy-cross/mpy-cross
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: Build
Expand Down Expand Up @@ -380,7 +389,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: 3.x
- name: Set up submodules
id: set-up-submodules
uses: ./.github/actions/fetch_submodules
Expand All @@ -396,9 +405,15 @@ jobs:
gcc --version
arm-none-eabi-gcc --version
python3 --version
- name: Build mpy-cross
- name: Download mpy-cross
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: make -C mpy-cross -j2
uses: actions/download-artifact@v3
with:
name: mpy-cross
path: mpy-cross
- name: Make mpy-cross executable
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: sudo chmod +x mpy-cross/mpy-cross
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: Build
Expand Down Expand Up @@ -489,9 +504,15 @@ jobs:
python3 --version
ninja --version
cmake --version
- name: Build mpy-cross
- name: Download mpy-cross
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: make -C mpy-cross -j2
uses: actions/download-artifact@v3
with:
name: mpy-cross
path: mpy-cross
- name: Make mpy-cross executable
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: sudo chmod +x mpy-cross/mpy-cross
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: Build
Expand Down Expand Up @@ -537,7 +558,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v4
with:
python-version: "3.x"
python-version: 3.x
- name: Set up submodules
id: set-up-submodules
uses: ./.github/actions/fetch_submodules
Expand All @@ -552,9 +573,15 @@ jobs:
gcc --version
riscv64-unknown-elf-gcc --version
python3 --version
- name: Build mpy-cross
- name: Download mpy-cross
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: make -C mpy-cross -j2
uses: actions/download-artifact@v3
with:
name: mpy-cross
path: mpy-cross
- name: Make mpy-cross executable
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
run: sudo chmod +x mpy-cross/mpy-cross
- name: Setup build failure matcher
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
- name: Build
Expand Down
6 changes: 2 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ typer
sh
click
cpp-coveralls

requests
requests-cache

# For translate check
polib

# For pre-commit
pyyaml
black
pyyaml
pre-commit

# for combining the Nordic SoftDevice with CircuitPython
Expand All @@ -23,9 +24,6 @@ intelhex
# for building & testing natmods
pyelftools

# for stubs and annotations
adafruit-circuitpython-typing

# for mbedtls certificate store
cryptography

Expand Down
4 changes: 3 additions & 1 deletion tools/ci_set_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ def get_settings(board):
break

# Split boards by architecture.
print("Building boards:")
build_boards = bool(boards_to_build)
print("Building boards:", build_boards)
set_output("build-boards", build_boards)
arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []}
for board in sorted(boards_to_build):
print(" ", board)
Expand Down

0 comments on commit baaa236

Please sign in to comment.