summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
blob: 9899972ebd0247afeb5e0bcc2a8153fdde1e62cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# SPDX-FileCopyrightText: 2014 MicroPython & CircuitPython contributors (https://github.com/adafruit/circuitpython/graphs/contributors)
#
# SPDX-License-Identifier: MIT

name: Build CI

on:
  push:
  pull_request:
  release:
    types: [published]
  check_suite:
    types: [rerequested]

jobs:
  test:
    runs-on: ubuntu-20.04
    steps:
    - name: Dump GitHub context
      env:
        GITHUB_CONTEXT: ${{ toJson(github) }}
      run: echo "$GITHUB_CONTEXT"
    - uses: actions/checkout@v2.2.0
      with:
        submodules: true
        fetch-depth: 0
    - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
    - name: CircuitPython version
      run: |
        git describe --dirty --tags
        echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install deps
      run: |
        sudo apt-get update
        sudo apt-get install -y eatmydata
        sudo eatmydata apt-get install -y gettext librsvg2-bin mingw-w64 latexmk texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
        pip install requests sh click setuptools cpp-coveralls "Sphinx<4" sphinx-rtd-theme recommonmark sphinx-autoapi sphinxcontrib-svg2pdfconverter polib pyyaml astroid isort black awscli mypy
    - name: Versions
      run: |
        gcc --version
        python3 --version
    - name: Translations
      run: make check-translate
    - name: New boards check
      run: python3 -u ci_new_boards_check.py
      working-directory: tools
    - name: Duplicate USB VID/PID Check
      run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
    - name: Build and Validate Stubs
      run: make check-stubs -j2
    - uses: actions/upload-artifact@v2
      with:
        name: stubs
        path: circuitpython-stubs*
    - name: Test Documentation Build (HTML)
      run: sphinx-build -E -W -b html -D version=${{ env.CP_VERSION }} -D release=${{ env.CP_VERSION }} . _build/html
    - uses: actions/upload-artifact@v2
      with:
        name: docs
        path: _build/html
    - name: Test Documentation Build (LaTeX/PDF)
      run: |
        make latexpdf
    - uses: actions/upload-artifact@v2
      with:
        name: docs
        path: _build/latex
    - name: Build mpy-cross
      run: make -C mpy-cross -j2
    - name: Build unix port
      run: |
        make -C ports/unix deplibs -j2
        make -C ports/unix -j2
        make -C ports/unix coverage -j2
    - name: Test all
      run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1
      working-directory: tests
    - name: Print failure info
      run: |
        for exp in *.exp;
        do testbase=$(basename $exp .exp);
        echo -e "\nFAILURE $testbase";
        diff -u $testbase.exp $testbase.out;
        done
      working-directory: tests
      if: failure()
    - name: Native Tests
      run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native
      working-directory: tests
    - name: mpy Tests
      run: MICROPY_CPYTHON3=python3.8 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float
      working-directory: tests
    - name: Build mpy-cross.static-raspbian
      run: make -C mpy-cross -j2 -f Makefile.static-raspbian
    - uses: actions/upload-artifact@v2
      with:
        name: mpy-cross.static-raspbian
        path: mpy-cross/mpy-cross.static-raspbian
    - name: Build mpy-cross.static
      run: make -C mpy-cross -j2 -f Makefile.static
    - uses: actions/upload-artifact@v2
      with:
        name: mpy-cross.static-amd64-linux
        path: mpy-cross/mpy-cross.static
    - name: Build mpy-cross.static-mingw
      run: make -C mpy-cross -j2 -f Makefile.static-mingw
    - uses: actions/upload-artifact@v2
      with:
        name: mpy-cross.static-x64-windows
        path: mpy-cross/mpy-cross.static.exe
    - name: Upload stubs and mpy-cross builds to S3
      run: |
        [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static-raspbian s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-raspbian-${{ env.CP_VERSION }} --no-progress --region us-east-1
        [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross.static s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross.static-amd64-linux-${{ env.CP_VERSION }} --no-progress --region us-east-1
        [ -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
        zip -9r circuitpython-stubs.zip circuitpython-stubs
        [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp circuitpython-stubs.zip s3://adafruit-circuit-python/bin/stubs/circuitpython-stubs-${{ env.CP_VERSION }}.zip --no-progress --region us-east-1
      env:
        AWS_PAGER: ''
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))


  mpy-cross-mac:
    runs-on: macos-10.15
    steps:
    - name: Dump GitHub context
      env:
        GITHUB_CONTEXT: ${{ toJson(github) }}
      run: echo "$GITHUB_CONTEXT"
    - name: Install dependencies
      run: |
        brew install gettext
        echo >>$GITHUB_PATH /usr/local/opt/gettext/bin
    - name: Versions
      run: |
        gcc --version
        python3 --version
        msgfmt --version
    - uses: actions/checkout@v2.2.0
      with:
        submodules: true
        fetch-depth: 0
    - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
    - name: CircuitPython version
      run: |
        git describe --dirty --tags
        echo >>$GITHUB_ENV CP_VERSION=$(git describe --dirty --tags)
    - name: Build mpy-cross
      run: make -C mpy-cross -j2
    - uses: actions/upload-artifact@v2
      with:
        name: mpy-cross-macos-catalina
        path: mpy-cross/mpy-cross
    - name: Upload mpy-cross build to S3
      run: |
        [ -z "$AWS_ACCESS_KEY_ID" ] || aws s3 cp mpy-cross/mpy-cross s3://adafruit-circuit-python/bin/mpy-cross/mpy-cross-macos-catalina-${{ env.CP_VERSION }} --no-progress --region us-east-1
      env:
        AWS_PAGER: ''
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))


  build-arm:
    runs-on: ubuntu-20.04
    needs: test
    strategy:
      fail-fast: false
      matrix:
        board:
        - "8086_commander"
        - "ADM_B_NRF52840_1"
        - "TG-Watch02A"
        - "aloriumtech_evo_m51"
        - "aramcon_badge_2019"
        - "arduino_mkr1300"
        - "arduino_mkrzero"
        - "arduino_nano_33_ble"
        - "arduino_nano_33_iot"
        - "arduino_zero"
        - "bast_pro_mini_m0"
        - "bastble"
        - "bdmicro_vina_d21"
        - "bdmicro_vina_d51"
        - "bless_dev_board_multi_sensor"
        - "blm_badge"
        - "capablerobot_usbhub"
        - "catwan_usbstick"
        - "circuitbrains_basic_m0"
        - "circuitbrains_deluxe_m4"
        - "circuitplayground_bluefruit"
        - "circuitplayground_express"
        - "circuitplayground_express_crickit"
        - "circuitplayground_express_displayio"
        - "clue_nrf52840_express"
        - "cp32-m4"
        - "cp_sapling_m0"
        - "cp_sapling_m0_spiflash"
        - "datalore_ip_m4"
        - "datum_distance"
        - "datum_imu"
        - "datum_light"
        - "datum_weather"
        - "dynossat_edu_eps"
        - "dynossat_edu_obc"
        - "electronut_labs_blip"
        - "electronut_labs_papyr"
        - "escornabot_makech"
        - "espruino_pico"
        - "espruino_wifi"
        - "feather_bluefruit_sense"
        - "feather_m0_adalogger"
        - "feather_m0_basic"
        - "feather_m0_express"
        - "feather_m0_express_crickit"
        - "feather_m0_rfm69"
        - "feather_m0_rfm9x"
        - "feather_m0_supersized"
        - "feather_m4_can"
        - "feather_m4_express"
        - "feather_m7_1011"
        - "feather_mimxrt1011"
        - "feather_mimxrt1062"
        - "feather_nrf52840_express"
        - "feather_radiofruit_zigbee"
        - "feather_stm32f405_express"
        - "fluff_m0"
        - "gemma_m0"
        - "grandcentral_m4_express"
        - "hallowing_m0_express"
        - "hallowing_m4_express"
        - "hiibot_bluefi"
        - "ikigaisense_vita"
        - "imxrt1010_evk"
        - "imxrt1020_evk"
        - "imxrt1060_evk"
        - "itsybitsy_m0_express"
        - "itsybitsy_m4_express"
        - "itsybitsy_nrf52840_express"
        - "kicksat-sprite"
        - "loc_ber_m4_base_board"
        - "makerdiary_m60_keyboard"
        - "makerdiary_nrf52840_m2_devkit"
        - "makerdiary_nrf52840_mdk"
        - "makerdiary_nrf52840_mdk_usb_dongle"
        - "matrixportal_m4"
        - "meowbit_v121"
        - "meowmeow"
        - "metro_m0_express"
        - "metro_m4_airlift_lite"
        - "metro_m4_express"
        - "metro_m7_1011"
        - "metro_nrf52840_express"
        - "mini_sam_m4"
        - "monster_m4sk"
        - "ndgarage_ndbit6"
        - "ndgarage_ndbit6_v2"
        - "neopixel_trinkey_m0"
        - "nfc_copy_cat"
        - "nice_nano"
        - "nucleo_f746zg"
        - "nucleo_f767zi"
        - "nucleo_h743zi_2"
        - "ohs2020_badge"
        - "openbook_m4"
        - "openmv_h7"
        - "particle_argon"
        - "particle_boron"
        - "particle_xenon"
        - "pca10056"
        - "pca10059"
        - "pca10100"
        - "pewpew10"
        - "pewpew_m4"
        - "picoplanet"
        - "pirkey_m0"
        - "pitaya_go"
        - "pyb_nano_v2"
        - "pybadge"
        - "pybadge_airlift"
        - "pyboard_v11"
        - "pycubed"
        - "pycubed_mram"
        - "pygamer"
        - "pygamer_advance"
        - "pyportal"
        - "pyportal_titano"
        - "pyruler"
        - "qtpy_m0"
        - "qtpy_m0_haxpress"
        - "raytac_mdbt50q-db-40"
        - "robohatmm1_m4"
        - "sam32"
        - "same54_xplained"
        - "seeeduino_wio_terminal"
        - "seeeduino_xiao"
        - "serpente"
        - "shirtty"
        - "simmel"
        - "snekboard"
        - "sparkfun_lumidrive"
        - "sparkfun_nrf52840_mini"
        - "sparkfun_qwiic_micro_no_flash"
        - "sparkfun_qwiic_micro_with_flash"
        - "sparkfun_redboard_turbo"
        - "sparkfun_samd21_dev"
        - "sparkfun_samd21_mini"
        - "sparkfun_samd51_thing_plus"
        - "spresense"
        - "stackrduino_m0_pro"
        - "stm32f411ce_blackpill"
        - "stm32f411ve_discovery"
        - "stm32f412zg_discovery"
        - "stm32f4_discovery"
        - "stm32f746g_discovery"
        - "stringcar_m0_express"
        - "teensy40"
        - "teensy41"
        - "teknikio_bluebird"
        - "thunderpack_v11"
        - "thunderpack_v12"
        - "tinkeringtech_scoutmakes_azul"
        - "trellis_m4_express"
        - "trinket_m0"
        - "trinket_m0_haxpress"
        - "uartlogger2"
        - "uchip"
        - "ugame10"
        - "winterbloom_big_honking_button"
        - "winterbloom_sol"
        - "xinabox_cc03"
        - "xinabox_cs11"

    steps:
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install deps
      run: |
        sudo apt-get install -y gettext
        pip install requests sh click setuptools awscli
        wget --no-verbose https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
        sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
    - name: Versions
      run: |
        gcc --version
        arm-none-eabi-gcc --version
        python3 --version
    - uses: actions/checkout@v2.2.0
      with:
        submodules: true
        fetch-depth: 0
    - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
    - name: mpy-cross
      run: make -C mpy-cross -j2
    - name: build
      run: python3 -u build_release_files.py
      working-directory: tools
      env:
        BOARDS: ${{ matrix.board }}
    - uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.board }}
        path: bin/${{ matrix.board }}
    - name: Upload to S3
      run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
      env:
        AWS_PAGER: ''
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))

  build-riscv:
    runs-on: ubuntu-20.04
    needs: test
    strategy:
      fail-fast: false
      matrix:
        board:
        - "fomu"

    steps:
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install deps
      run: |
        sudo apt-get install -y gettext
        pip install requests sh click setuptools awscli
        wget https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz
        sudo tar -C /usr --strip-components=1 -xaf riscv64-unknown-elf-gcc-8.3.0-2019.08.0-x86_64-linux-centos6.tar.gz
    - name: Versions
      run: |
        gcc --version
        riscv64-unknown-elf-gcc --version
        python3 --version
    - uses: actions/checkout@v2.2.0
      with:
        submodules: true
        fetch-depth: 0
    - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
    - name: mpy-cross
      run: make -C mpy-cross -j2
    - name: build
      run: python3 -u build_release_files.py
      working-directory: tools
      env:
        BOARDS: ${{ matrix.board }}
    - uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.board }}
        path: bin/${{ matrix.board }}
    - name: Upload to S3
      run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
      env:
        AWS_PAGER: ''
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))
  build-xtensa:
    runs-on: ubuntu-20.04
    needs: test
    strategy:
      fail-fast: false
      matrix:
        board:
        - "adafruit_feather_esp32s2_nopsram"
        - "adafruit_feather_esp32s2_tftback_nopsram"
        - "adafruit_magtag_2.9_grayscale"
        - "adafruit_metro_esp32s2"
        - "electroniccats_bastwifi"
        - "espressif_kaluga_1"
        - "espressif_saola_1_wroom"
        - "espressif_saola_1_wrover"
        - "microdev_micro_s2"
        - "muselab_nanoesp32_s2"
        - "targett_module_clip_wroom"
        - "targett_module_clip_wrover"
        - "unexpectedmaker_feathers2"
        - "unexpectedmaker_feathers2_prerelease"

    steps:
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - uses: actions/checkout@v2.2.0
      with:
        submodules: true
        fetch-depth: 0
    - run: git fetch --recurse-submodules=no https://github.com/adafruit/circuitpython refs/tags/*:refs/tags/*
    - name: CircuitPython version
      run: git describe --dirty --tags
    - uses: actions/cache@v1
      name: Fetch IDF tool cache
      id: idf-cache
      with:
        path: ${{ github.workspace }}/.idf_tools
        key: ${{ runner.os }}-idf-tools-${{ hashFiles('.git/modules/ports/esp32s2/esp-idf/HEAD') }}-20200801
    - name: Clone IDF submodules
      run: |
        (cd $IDF_PATH && git submodule update --init)
      env:
        IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf
    - name: Install IDF tools
      run: |
        $IDF_PATH/tools/idf_tools.py --non-interactive install required
        $IDF_PATH/tools/idf_tools.py --non-interactive install cmake
        $IDF_PATH/tools/idf_tools.py --non-interactive install-python-env
        rm -rf $IDF_TOOLS_PATH/dist
      env:
        IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf
        IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
    - name: Install CircuitPython deps
      run: |
        source $IDF_PATH/export.sh
        pip install requests sh click setuptools awscli
        sudo apt-get install -y gettext ninja-build
      env:
        IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf
        IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
    - name: Versions
      run: |
        source $IDF_PATH/export.sh
        gcc --version
        xtensa-esp32s2-elf-gcc --version
        python3 --version
        ninja --version
        cmake --version
      shell: bash
      env:
        IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf
        IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
    - name: mpy-cross
      run: make -C mpy-cross -j2
    - name: build
      run: |
        source $IDF_PATH/export.sh
        python3 -u build_release_files.py
      working-directory: tools
      shell: bash
      env:
        IDF_PATH: ${{ github.workspace }}/ports/esp32s2/esp-idf
        IDF_TOOLS_PATH: ${{ github.workspace }}/.idf_tools
        BOARDS: ${{ matrix.board }}
    - uses: actions/upload-artifact@v2
      with:
        name: ${{ matrix.board }}
        path: bin/${{ matrix.board }}
    - name: Upload to S3
      run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/ s3://adafruit-circuit-python/bin/ --recursive --no-progress --region us-east-1"
      env:
        AWS_PAGER: ''
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      if: github.event_name == 'push' || (github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'rerequested'))