acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

main.yml (8288B)

      1 name: CI
      2 
      3 on:
      4   push:
      5     branches: [ master ]
      6   pull_request:
      7     branches: [ master ]
      8   workflow_dispatch:
      9 
     10 jobs:
     11 
     12   build:
     13     strategy:
     14       matrix:
     15         board:
     16           - arduino:avr:uno
     17           - arduino:avr:mega
     18           - arduino:avr:leonardo
     19           - arduino:mbed:nano33ble
     20           - arduino:mbed:envie_m4
     21           - arduino:megaavr:uno2018
     22           - arduino:sam:arduino_due_x
     23           - arduino:samd:arduino_zero_native
     24           - adafruit:samd:adafruit_feather_m0
     25           - adafruit:nrf52:feather52832
     26           - esp32:esp32:esp32
     27           - esp8266:esp8266:generic
     28           - Intel:arc32:arduino_101
     29           - SparkFun:apollo3:sfe_artemis
     30           - STMicroelectronics:stm32:GenF3
     31           - stm32duino:STM32F1:mapleMini
     32           - MegaCoreX:megaavr:4809
     33           - arduino:mbed_rp2040:pico
     34           - CubeCell:CubeCell:CubeCell-Board
     35           - MegaCore:avr:1281
     36           - teensy:avr:teensy41
     37 
     38     runs-on: ubuntu-latest
     39     name: ${{ matrix.board }}
     40     env:
     41       run-build: ${{ (matrix.board == 'arduino:avr:uno') || contains(github.event.head_commit.message, 'CI_BUILD_ALL') || contains(github.event.head_commit.message, 'Bump version to') || contains(github.event.head_commit.message, format('{0}', matrix.board)) }}
     42 
     43     steps:
     44       - name: Install arduino-cli
     45         if: ${{ env.run-build == 'true' }}
     46         run:
     47           |
     48           mkdir -p ~/.local/bin
     49           echo "~/.local/bin" >> $GITHUB_PATH
     50           curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh
     51 
     52       - name: Get platform name
     53         if: ${{ env.run-build == 'true' }}
     54         uses: jungwinter/split@v1
     55         id: split
     56         with:
     57           msg: ${{ matrix.board }}
     58           seperator: ':'
     59 
     60       - name: Prepare platform-specific settings
     61         if: ${{ env.run-build == 'true' }}
     62         id: prep
     63         run:
     64           |
     65           # common settings - no extra options, skip nothing, all warnings
     66           echo "::set-output name=options::"
     67           echo "::set-output name=skip-pattern::''"
     68           echo "::set-output name=warnings::'all'"
     69 
     70           # platform-dependent settings - extra board options, board index URLs, skip patterns etc.
     71           if [[ "${{ contains(matrix.board, 'arduino:avr:mega') }}" == "true" ]]; then
     72             # Arduino Mega
     73             echo "::set-output name=options:::cpu=atmega2560"
     74 
     75           elif [[ "${{ contains(matrix.board, 'arduino:mbed') }}" == "true" ]]; then
     76             # Arduino Nano 33 BLE
     77             echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"
     78 
     79           elif [[ "${{ contains(matrix.board, 'arduino-beta:mbed') }}" == "true" ]]; then
     80             # Arduino Portenta H7
     81             echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"
     82 
     83           elif [[ "${{ contains(matrix.board, 'arduino:megaavr:uno2018') }}" == "true" ]]; then
     84             # Arduino Uno WiFi
     85             echo "::set-output name=options:::mode=on"
     86 
     87           elif [[ "${{ contains(matrix.board, 'adafruit:samd') }}" == "true" ]]; then
     88             # Adafruit SAMD
     89             echo "::set-output name=options:::usbstack=arduino,debug=off"
     90             echo "::set-output name=index-url::--additional-urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json"
     91 
     92           elif [[ "${{ contains(matrix.board, 'adafruit:nrf52') }}" == "true" ]]; then
     93             # Adafruit Feather nRF52
     94             sudo apt-get update
     95             sudo apt-get install -y python3 python3-pip python3-setuptools
     96             pip3 install wheel
     97             pip3 install --user adafruit-nrfutil
     98             echo "/home/runner/.local/bin" >> $GITHUB_PATH
     99             echo "::set-output name=options:::softdevice=s132v6,debug=l0"
    100             echo "::set-output name=index-url::--additional-urls https://adafruit.github.io/arduino-board-index/package_adafruit_index.json"
    101 
    102           elif [[ "${{ contains(matrix.board, 'esp32:esp32') }}" == "true" ]]; then
    103             # ESP32
    104             python -m pip install pyserial
    105             echo "::set-output name=index-url::--additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
    106 
    107           elif [[ "${{ contains(matrix.board, 'esp8266:esp8266') }}" == "true" ]]; then
    108             # ESP8266
    109             echo "::set-output name=options:::xtal=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=qio,eesz=512K"
    110             echo "::set-output name=index-url::--additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json"
    111             echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"
    112 
    113           elif [[ "${{ contains(matrix.board, 'SparkFun:apollo3') }}" == "true" ]]; then
    114             # SparkFun Apollo
    115             echo "::set-output name=index-url::--additional-urls https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json"
    116             echo "::set-output name=warnings::'none'"
    117             echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"
    118 
    119           elif [[ "${{ contains(matrix.board, 'STMicroelectronics:stm32') }}" == "true" ]]; then
    120             # STM32 (official core)
    121             echo "::set-output name=options:::pnum=BLACKPILL_F303CC"
    122             echo "::set-output name=index-url::--additional-urls https://raw.githubusercontent.com/stm32duino/BoardManagerFiles/main/package_stmicroelectronics_index.json"
    123 
    124           elif [[ "${{ contains(matrix.board, 'stm32duino:STM32F1') }}" == "true" ]]; then
    125             # STM32 (unofficial core)
    126             echo "::set-output name=options:::bootloader_version=original,cpu_speed=speed_72mhz"
    127             echo "::set-output name=index-url::--additional-urls http://dan.drown.org/stm32duino/package_STM32duino_index.json"
    128 
    129           elif [[ "${{ contains(matrix.board, 'MegaCoreX:megaavr') }}" == "true" ]]; then
    130             # MegaCoreX
    131             echo "::set-output name=index-url::--additional-urls https://mcudude.github.io/MegaCoreX/package_MCUdude_MegaCoreX_index.json"
    132 
    133           elif [[ "${{ contains(matrix.board, 'CubeCell:CubeCell') }}" == "true" ]]; then
    134             # CubeCell
    135             echo "::set-output name=index-url::--additional-urls https://resource.heltec.cn/download/package_CubeCell_index.json"
    136 
    137           elif [[ "${{ contains(matrix.board, 'MegaCore:avr') }}" == "true" ]]; then
    138             # MegaCore
    139             echo "::set-output name=index-url::--additional-urls https://mcudude.github.io/MegaCore/package_MCUdude_MegaCore_index.json"
    140 
    141           elif [[ "${{ contains(matrix.board, 'teensy:avr') }}" == "true" ]]; then
    142             # Teensy
    143             echo "::set-output name=index-url::--additional-urls https://www.pjrc.com/teensy/td_156/package_teensy_index.json"
    144 
    145           fi
    146 
    147       - name: Install platform
    148         if: ${{ env.run-build == 'true' }}
    149         run:
    150           |
    151           arduino-cli core update-index ${{ format('{0}', steps.prep.outputs.index-url) }}
    152           arduino-cli core install ${{ format('{0}:{1} {2}', steps.split.outputs._0, steps.split.outputs._1, steps.prep.outputs.index-url) }}
    153 
    154       - name: Checkout repository
    155         if: ${{ env.run-build == 'true' }}
    156         uses: actions/checkout@v2
    157 
    158       - name: Build examples
    159         if: ${{ env.run-build == 'true' }}
    160         run:
    161           |
    162           for example in $(find $PWD/examples -name '*.ino' | sort); do
    163             # check whether to skip this sketch
    164             if [ ! -z '${{ steps.prep.outputs.skip-pattern }}' ] && [[ ${example} =~ ${{ steps.prep.outputs.skip-pattern }} ]]; then
    165               # skip sketch
    166               echo -e "\n\033[1;33mSkipped ${example##*/} (matched with ${{ steps.prep.outputs.skip-pattern }})\033[0m";
    167             else
    168               # build sketch
    169               echo -e "\n\033[1;33mBuilding ${example##*/} ... \033[0m";
    170               arduino-cli compile --libraries /home/runner/work/RadioLib --fqbn ${{ matrix.board }}${{ steps.prep.outputs.options }} $example --warnings=${{ steps.prep.outputs.warnings }}
    171               if [ $? -ne 0 ]; then
    172                 echo -e "\033[1;31m${example##*/} build FAILED\033[0m\n";
    173                 exit 1;
    174               else
    175                 echo -e "\033[1;32m${example##*/} build PASSED\033[0m\n";
    176               fi
    177             fi
    178           done