Skip to content

Commit baaa236

Browse files
committed
use already built mpy-cross
1 parent e3b924b commit baaa236

File tree

3 files changed

+60
-33
lines changed

3 files changed

+60
-33
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,15 @@ jobs:
2121
runs-on: ubuntu-20.04
2222
outputs:
2323
build-doc: ${{ steps.set-matrix.outputs.build-doc }}
24+
build-boards: ${{ steps.set-matrix.outputs.build-boards }}
2425
boards-aarch: ${{ steps.set-matrix.outputs.boards-aarch }}
2526
boards-arm: ${{ steps.set-matrix.outputs.boards-arm }}
2627
boards-espressif: ${{ steps.set-matrix.outputs.boards-espressif }}
2728
boards-riscv: ${{ steps.set-matrix.outputs.boards-riscv }}
2829
cp-version: ${{ steps.set-up-submodules.outputs.version }}
30+
env:
31+
MICROPY_CPYTHON3: python3.8
32+
MICROPY_MICROPYTHON: ${{ github.workspace }}/ports/unix/micropython-coverage
2933
steps:
3034
- name: Dump GitHub context
3135
run: echo "$GITHUB_CONTEXT"
@@ -39,14 +43,14 @@ jobs:
3943
- name: Set up python
4044
uses: actions/setup-python@v4
4145
with:
42-
python-version: "3.x"
46+
python-version: 3.x
4347
- name: Duplicate USB VID/PID check
4448
run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
4549
- name: Set up submodules
4650
id: set-up-submodules
4751
uses: ./.github/actions/fetch_submodules
4852
with:
49-
cache: "cache"
53+
cache: cache
5054
version: true
5155
- name: Install dependencies
5256
run: |
@@ -60,24 +64,27 @@ jobs:
6064
python3 --version
6165
- name: Build mpy-cross
6266
run: make -C mpy-cross -j2
67+
- uses: actions/upload-artifact@v3
68+
with:
69+
name: mpy-cross
70+
path: mpy-cross/mpy-cross
6371
- name: Build unix port
64-
run: |
65-
make -C ports/unix VARIANT=coverage -j2
72+
run: make -C ports/unix VARIANT=coverage -j2
6673
- name: Test all
67-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1
74+
run: ./run-tests.py -j2
6875
working-directory: tests
6976
- name: Print failure info
70-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --print-failures
77+
run: ./run-tests.py -j2 --print-failures
7178
if: failure()
7279
working-directory: tests
7380
- name: Native Tests
74-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --emit native
81+
run: ./run-tests.py -j2 --emit native
7582
working-directory: tests
7683
- name: mpy Tests
77-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --via-mpy -d basics float micropython
84+
run: ./run-tests.py -j2 --via-mpy -d basics float micropython
7885
working-directory: tests
7986
- name: Native mpy Tests
80-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-tests.py -j1 --via-mpy --emit native -d basics float micropython
87+
run: ./run-tests.py -j2 --via-mpy --emit native -d basics float micropython
8188
working-directory: tests
8289
- name: Build native modules
8390
run: |
@@ -90,7 +97,7 @@ jobs:
9097
make -C examples/natmod/ure
9198
make -C examples/natmod/uzlib
9299
- name: Test native modules
93-
run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython-coverage ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py
100+
run: ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py
94101
working-directory: tests
95102
- name: Build mpy-cross.static-aarch64
96103
run: make -C mpy-cross -j2 -f Makefile.static-aarch64
@@ -166,11 +173,7 @@ jobs:
166173
mpy-cross-mac:
167174
runs-on: macos-11
168175
needs: test
169-
if: >-
170-
needs.test.outputs.boards-aarch != '[]' ||
171-
needs.test.outputs.boards-arm != '[]' ||
172-
needs.test.outputs.boards-espressif != '[]' ||
173-
needs.test.outputs.boards-riscv != '[]'
176+
if: ${{ needs.test.outputs.build-boards == 'True' }}
174177
env:
175178
CP_VERSION: ${{ needs.test.outputs.cp-version }}
176179
steps:
@@ -182,7 +185,7 @@ jobs:
182185
- name: Set up python
183186
uses: actions/setup-python@v4
184187
with:
185-
python-version: "3.x"
188+
python-version: 3.x
186189
- name: Set up submodules
187190
uses: ./.github/actions/fetch_submodules
188191
- name: Versions
@@ -235,7 +238,7 @@ jobs:
235238
- name: Set up python
236239
uses: actions/setup-python@v4
237240
with:
238-
python-version: "3.x"
241+
python-version: 3.x
239242
- name: Set up submodules
240243
uses: ./.github/actions/fetch_submodules
241244
- name: Install dependencies
@@ -305,7 +308,7 @@ jobs:
305308
- name: Set up python
306309
uses: actions/setup-python@v4
307310
with:
308-
python-version: "3.x"
311+
python-version: 3.x
309312
- name: Set up submodules
310313
id: set-up-submodules
311314
uses: ./.github/actions/fetch_submodules
@@ -334,9 +337,15 @@ jobs:
334337
arm-none-eabi-gcc --version
335338
python3 --version
336339
mkfs.fat --version || true
337-
- name: Build mpy-cross
340+
- name: Download mpy-cross
338341
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
339-
run: make -C mpy-cross -j2
342+
uses: actions/download-artifact@v3
343+
with:
344+
name: mpy-cross
345+
path: mpy-cross
346+
- name: Make mpy-cross executable
347+
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
348+
run: sudo chmod +x mpy-cross/mpy-cross
340349
- name: Setup build failure matcher
341350
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
342351
- name: Build
@@ -380,7 +389,7 @@ jobs:
380389
- name: Set up python
381390
uses: actions/setup-python@v4
382391
with:
383-
python-version: "3.x"
392+
python-version: 3.x
384393
- name: Set up submodules
385394
id: set-up-submodules
386395
uses: ./.github/actions/fetch_submodules
@@ -396,9 +405,15 @@ jobs:
396405
gcc --version
397406
arm-none-eabi-gcc --version
398407
python3 --version
399-
- name: Build mpy-cross
408+
- name: Download mpy-cross
400409
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
401-
run: make -C mpy-cross -j2
410+
uses: actions/download-artifact@v3
411+
with:
412+
name: mpy-cross
413+
path: mpy-cross
414+
- name: Make mpy-cross executable
415+
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
416+
run: sudo chmod +x mpy-cross/mpy-cross
402417
- name: Setup build failure matcher
403418
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
404419
- name: Build
@@ -489,9 +504,15 @@ jobs:
489504
python3 --version
490505
ninja --version
491506
cmake --version
492-
- name: Build mpy-cross
507+
- name: Download mpy-cross
493508
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
494-
run: make -C mpy-cross -j2
509+
uses: actions/download-artifact@v3
510+
with:
511+
name: mpy-cross
512+
path: mpy-cross
513+
- name: Make mpy-cross executable
514+
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
515+
run: sudo chmod +x mpy-cross/mpy-cross
495516
- name: Setup build failure matcher
496517
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
497518
- name: Build
@@ -537,7 +558,7 @@ jobs:
537558
- name: Set up python
538559
uses: actions/setup-python@v4
539560
with:
540-
python-version: "3.x"
561+
python-version: 3.x
541562
- name: Set up submodules
542563
id: set-up-submodules
543564
uses: ./.github/actions/fetch_submodules
@@ -552,9 +573,15 @@ jobs:
552573
gcc --version
553574
riscv64-unknown-elf-gcc --version
554575
python3 --version
555-
- name: Build mpy-cross
576+
- name: Download mpy-cross
556577
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
557-
run: make -C mpy-cross -j2
578+
uses: actions/download-artifact@v3
579+
with:
580+
name: mpy-cross
581+
path: mpy-cross
582+
- name: Make mpy-cross executable
583+
if: ${{ steps.set-up-submodules.outputs.frozen == 'True' }}
584+
run: sudo chmod +x mpy-cross/mpy-cross
558585
- name: Setup build failure matcher
559586
run: echo "::add-matcher::$GITHUB_WORKSPACE/.github/workflows/match-build-fail.json"
560587
- name: Build

requirements-dev.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ typer
66
sh
77
click
88
cpp-coveralls
9+
910
requests
1011
requests-cache
1112

1213
# For translate check
1314
polib
1415

1516
# For pre-commit
16-
pyyaml
1717
black
18+
pyyaml
1819
pre-commit
1920

2021
# for combining the Nordic SoftDevice with CircuitPython
@@ -23,9 +24,6 @@ intelhex
2324
# for building & testing natmods
2425
pyelftools
2526

26-
# for stubs and annotations
27-
adafruit-circuitpython-typing
28-
2927
# for mbedtls certificate store
3028
cryptography
3129

tools/ci_set_matrix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ def get_settings(board):
204204
break
205205

206206
# Split boards by architecture.
207-
print("Building boards:")
207+
build_boards = bool(boards_to_build)
208+
print("Building boards:", build_boards)
209+
set_output("build-boards", build_boards)
208210
arch_to_boards = {"aarch": [], "arm": [], "riscv": [], "espressif": []}
209211
for board in sorted(boards_to_build):
210212
print(" ", board)

0 commit comments

Comments
 (0)