/ .github / workflows / githubci.yml
githubci.yml
  1  name: Arduino Library CI
  2  
  3  on: [pull_request, push, repository_dispatch]
  4  
  5  jobs:
  6    spdx:
  7      runs-on: ubuntu-latest
  8      steps:
  9      - uses: actions/setup-python@v4
 10        with:
 11          python-version: "3.x"
 12      - name: Checkout Current Repo
 13        uses: actions/checkout@v3
 14  
 15      - name: check SPDX licensing
 16        run: python ./SPDX.py
 17  
 18    arduino:
 19      strategy:
 20        fail-fast: false
 21        matrix:
 22          arduino-platform: ["cpb", "cpc", "cpx_ada", "esp32", "esp8266", "feather32u4", "feather_m0_express", "feather_m4_express", "feather_rp2040", "flora", "funhouse", "gemma", "gemma_m0", "hallowing_m0", "hallowing_m4_tinyusb", "magtag", "metro_m0", "metro_m0_tinyusb", "metro_m4", "metro_m4_tinyusb", "monster_m4sk", "monster_m4sk_tinyusb", "neokeytrinkey_m0", "neotrellis_m4", "nrf52832", "nrf52840", "protrinket_5v", "proxlighttrinkey_m0", "pybadge", "pygamer", "pyportal", "qt2040_trinkey", "qtpy_m0", "qtpy_esp32s2", "rotarytrinkey_m0", "slidetrinkey_m0", "trinket_m0", "uno", "trinket_5v", "ledglasses_nrf52840" ]
 23      runs-on: ubuntu-latest
 24  
 25      steps:
 26      - uses: actions/setup-python@v4
 27        with:
 28          python-version: "3.x"
 29      - uses: actions/checkout@v3
 30      - uses: actions/checkout@v3
 31        with:
 32           repository: adafruit/ci-arduino
 33           path: ci
 34  
 35      - name: pre-install
 36        run: bash ci/actions_install.sh
 37  
 38      # manually install some libraries
 39      - name: extra libraries
 40        run: |
 41          git clone --quiet https://github.com/adafruit/Cryptosuite.git /home/runner/Arduino/libraries/Cryptosuite
 42          git clone --quiet https://github.com/adafruit/WiFiNINA.git /home/runner/Arduino/libraries/WiFiNINA
 43          git clone --quiet https://github.com/adafruit/Adafruit_LSM303.git /home/runner/Arduino/libraries/Adafruit_LSM303
 44          git clone --quiet https://github.com/moderndevice/CapSense.git /home/runner/Arduino/libraries/CapSense
 45          git clone --quiet https://github.com/PaintYourDragon/ffft.git /home/runner/Arduino/libraries/ffft
 46          git clone --quiet https://github.com/adafruit/RadioHead.git /home/runner/Arduino/libraries/RadioHead
 47          git clone --quiet https://github.com/me-no-dev/ESPAsyncTCP /home/runner/Arduino/libraries/ESPAsyncTCP
 48          git clone --quiet https://github.com/adafruit/Talkie /home/runner/Arduino/libraries/Talkie
 49          git clone --quiet https://github.com/Infineon/arduino-optiga-trust-m /home/runner/Arduino/libraries/arduinoOptigaTrustM
 50          git clone --quiet https://github.com/adafruit/HID /home/runner/Arduino/libraries/HID_Project
 51          rm -rf /home/runner/Arduino/libraries/ArduinoHttpClient
 52          git clone --quiet https://github.com/arduino-libraries/ArduinoHttpClient.git /home/runner/Arduino/libraries/ArduinoHttpClient
 53  
 54      - name: test platforms
 55        run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
 56  
 57  
 58      - name: Upload build artifacts
 59        uses: actions/upload-artifact@v3
 60        with:
 61          name: ${{ github.event.repository.name }}.${{ github.sha }}
 62          path: |
 63              build/*.hex
 64              build/*.bin
 65              build/*.uf2
 66  
 67      - name: Zip release files
 68        if: startsWith(github.ref, 'refs/tags/')
 69        run: |
 70          if [ -d build ]; then
 71              (
 72              echo "Built from Adafruit Learning System Guides `git describe --tags` for ${{ matrix.arduino-platform }}"
 73              echo "Source code: https://github.com/adafruit/"
 74              echo "Adafruit Learning System: https://learn.adafruit.com/"
 75              ) > build/README.txt
 76              cd build && zip -9 -o ${{ matrix.arduino-platform }}.zip *.hex *.bin *.uf2 *.txt
 77          fi
 78  
 79      - name: Create release
 80        if: startsWith(github.ref, 'refs/tags/')
 81        uses: softprops/action-gh-release@v1
 82        with:
 83          files: build/${{ matrix.arduino-platform }}.zip
 84          fail_on_unmatched_files: false
 85          body: "Select the zip file corresponding to your board from the list below."
 86  
 87    pylint:
 88      runs-on: ubuntu-latest
 89      steps:
 90      - name: Set up Python 3.10
 91        uses: actions/setup-python@v4
 92        with:
 93          python-version: "3.10"
 94      - name: Versions
 95        run: |
 96          python3 --version
 97      - name: Pip install pylint
 98        run: |
 99          pip install --force-reinstall pylint==2.7.1
100      - name: Checkout Current Repo
101        uses: actions/checkout@v3
102  
103      - name: lint
104        run: ./pylint_check.sh