Skip to content

Commit

Permalink
Selectively build boards based on changed files
Browse files Browse the repository at this point in the history
This uses a step output from the test job to set the build matrix
for the board build jobs. The built boards depends on which files
were changed.

* Changes contained within ports/*/boards/ will build each board.
* Changes contained within ports/* will build all boards from the
  port.
* All other file changes will build all boards.

All boards will be build for pushes in `adafruit/circuitpython` as
well.

A side-effect is that we no longer need to explicitly list the
boards to build. It will automatically update as new folders are
added.

Related to micropython#4009
  • Loading branch information
tannewt committed Sep 7, 2021
1 parent daad0d0 commit a874043
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 296 deletions.
269 changes: 30 additions & 239 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
jobs:
test:
runs-on: ubuntu-20.04
outputs:
arm-boards: ${{ steps.set-matrix.outputs.arm-boards }}
riscv-boards: ${{ steps.set-matrix.outputs.riscv-boards }}
xtensa-boards: ${{ steps.set-matrix.outputs.xtensa-boards }}
steps:
- name: Dump GitHub context
env:
Expand Down Expand Up @@ -43,9 +47,6 @@ jobs:
run: |
gcc --version
python3 --version
- 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
Expand Down Expand Up @@ -139,6 +140,29 @@ jobs:
# setup.py sdist was run by 'make stubs'
[ -z "$TWINE_USERNAME" ] || echo "Uploading dev release to PyPi"
[ -z "$TWINE_USERNAME" ] || twine upload circuitpython-stubs/dist/*
- uses: dorny/paths-filter@v2
id: filter
with:
# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
# Paths will be formatted as JSON array
list-files: json

# Compare against this branch. (Ignored for PRs.)
base: ${{ github.ref }}

# In this example all changed files are passed to the following action to do
# some custom processing.
filters: |
changed:
- '**'
- name: "Set boards to build"
id: set-matrix
working-directory: tools
env:
CHANGED_FILES: ${{ steps.filter.outputs.changed_files }}
run: |
python3 -u ci_changed_board_list.py
mpy-cross-mac:
runs-on: macos-10.15
Expand Down Expand Up @@ -203,205 +227,7 @@ jobs:
strategy:
fail-fast: false
matrix:
board:
- "8086_commander"
- "ADM_B_NRF52840_1"
- "TG-Watch"
- "adafruit_feather_rp2040"
- "adafruit_itsybitsy_rp2040"
- "adafruit_led_glasses_nrf52840"
- "adafruit_macropad_rp2040"
- "adafruit_neokey_trinkey_m0"
- "adafruit_proxlight_trinkey_m0"
- "adafruit_qt2040_trinkey"
- "adafruit_qtpy_rp2040"
- "adafruit_rotary_trinkey_m0"
- "adafruit_slide_trinkey_m0"
- "aloriumtech_evo_m51"
- "aramcon2_badge"
- "aramcon_badge_2019"
- "arduino_mkr1300"
- "arduino_mkrzero"
- "arduino_nano_33_ble"
- "arduino_nano_33_iot"
- "arduino_nano_rp2040_connect"
- "arduino_zero"
- "bast_pro_mini_m0"
- "bastble"
- "bdmicro_vina_d21"
- "bdmicro_vina_d51"
- "bdmicro_vina_d51_pcb7"
- "bless_dev_board_multi_sensor"
- "blm_badge"
- "bluemicro840"
- "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_revb"
- "cp_sapling_m0_spiflash"
- "cytron_maker_pi_rp2040"
- "datalore_ip_m4"
- "datum_distance"
- "datum_imu"
- "datum_light"
- "datum_weather"
- "dynalora_usb"
- "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_stm32f405_express"
- "fluff_m0"
- "gemma_m0"
- "grandcentral_m4_express"
- "hallowing_m0_express"
- "hallowing_m4_express"
- "hiibot_bluefi"
- "huntercat_nfc"
- "ikigaisense_vita"
- "imxrt1010_evk"
- "imxrt1020_evk"
- "imxrt1060_evk"
- "itsybitsy_m0_express"
- "itsybitsy_m4_express"
- "itsybitsy_nrf52840_express"
- "jpconstantineau_encoderpad_rp2040"
- "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"
- "microbit_v2"
- "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"
- "pimoroni_interstate75"
- "pimoroni_keybow2040"
- "pimoroni_pga2040"
- "pimoroni_picolipo_16mb"
- "pimoroni_picolipo_4mb"
- "pimoroni_picosystem"
- "pimoroni_plasma2040"
- "pimoroni_tiny2040"
- "pitaya_go"
- "pyb_nano_v2"
- "pybadge"
- "pyboard_v11"
- "pycubed"
- "pycubed_mram"
- "pygamer"
- "pyportal"
- "pyportal_titano"
- "pyruler"
- "qtpy_m0"
- "qtpy_m0_haxpress"
- "raspberry_pi_pico"
- "raytac_mdbt50q-db-40"
- "raytac_mdbt50q-rx"
- "robohatmm1_m4"
- "sam32"
- "same54_xplained"
- "seeeduino_wio_terminal"
- "seeeduino_xiao"
- "sensebox_mcu"
- "serpente"
- "shirtty"
- "silicognition-m4-shim"
- "simmel"
- "snekboard"
- "sparkfun_lumidrive"
- "sparkfun_micromod_rp2040"
- "sparkfun_nrf52840_micromod"
- "sparkfun_nrf52840_mini"
- "sparkfun_pro_micro_rp2040"
- "sparkfun_qwiic_micro_no_flash"
- "sparkfun_qwiic_micro_with_flash"
- "sparkfun_redboard_turbo"
- "sparkfun_samd21_dev"
- "sparkfun_samd21_mini"
- "sparkfun_samd51_micromod"
- "sparkfun_samd51_thing_plus"
- "sparkfun_stm32f405_micromod"
- "sparkfun_thing_plus_rp2040"
- "spresense"
- "stackrduino_m0_pro"
- "stm32f411ce_blackpill"
- "stm32f411ce_blackpill_with_flash"
- "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"
- "warmbit_bluepixel"
- "winterbloom_big_honking_button"
- "winterbloom_sol"
- "xinabox_cc03"
- "xinabox_cs11"
board: ${{ fromJSON(needs.test.outputs.arm-boards) }}

steps:
- name: Set up Python 3.8
Expand Down Expand Up @@ -451,8 +277,7 @@ jobs:
strategy:
fail-fast: false
matrix:
board:
- "fomu"
board: ${{ fromJSON(needs.test.outputs.riscv-boards) }}

steps:
- name: Set up Python 3.8
Expand Down Expand Up @@ -501,41 +326,7 @@ jobs:
strategy:
fail-fast: false
matrix:
board:
- "adafruit_feather_esp32s2_nopsram"
- "adafruit_feather_esp32s2_tftback_nopsram"
- "adafruit_funhouse"
- "adafruit_magtag_2.9_grayscale"
- "adafruit_metro_esp32s2"
- "ai_thinker_esp_12k_nodemcu"
- "artisense_rd00"
- "atmegazero_esp32s2"
- "crumpspace_crumps2"
- "electroniccats_bastwifi"
- "espressif_hmi_devkit_1"
- "espressif_kaluga_1"
- "espressif_kaluga_1.3"
- "espressif_saola_1_wroom"
- "espressif_saola_1_wrover"
- "franzininho_wifi_wroom"
- "franzininho_wifi_wrover"
- "gravitech_cucumber_m"
- "gravitech_cucumber_ms"
- "gravitech_cucumber_r"
- "gravitech_cucumber_rs"
- "lilygo_ttgo_t8_s2_st7789"
- "lolin_s2_mini"
- "microdev_micro_s2"
- "morpheans_morphesp-240"
- "muselab_nanoesp32_s2_wroom"
- "muselab_nanoesp32_s2_wrover"
- "odt_pixelwing_esp32_s2"
- "targett_module_clip_wroom"
- "targett_module_clip_wrover"
- "unexpectedmaker_feathers2"
- "unexpectedmaker_feathers2_neo"
- "unexpectedmaker_feathers2_prerelease"
- "unexpectedmaker_tinys2"
board: ${{ fromJSON(needs.test.outputs.xtensa-boards) }}

steps:
- name: Set up Python 3.8
Expand Down
Loading

0 comments on commit a874043

Please sign in to comment.