Skip to content

Commit

Permalink
Restructure to isolate Arduino code.
Browse files Browse the repository at this point in the history
CI builds are now matrixed
Added Lolin D32 Pro CI build
  • Loading branch information
forkineye committed Sep 4, 2021
1 parent 7ce2ac8 commit c974fad
Show file tree
Hide file tree
Showing 92 changed files with 184 additions and 72 deletions.
48 changes: 41 additions & 7 deletions .ci/firmware.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"name": "ESPixelStick V3",
"description": "Official hardware from Forkineye",
"chip": "esp8266",
"appbin": "esp8266/app.bin",
"appbin": "esp8266/d1_mini-app.bin",
"esptool": {
"baudrate": "460800",
"options": "--before default_reset --after hard_reset",
"flashcmd": "write_flash"
},
"binfiles": [
{
"name": "esp8266/app.bin",
"name": "esp8266/d1_mini-app.bin",
"offset": "0x0"
}
],
Expand All @@ -25,32 +25,66 @@
"offset": "0x200000"
}
},

{
"name": "Lolin D32 Pro",
"description": "Lolin D32 Pro module with PSRAM support for DIY builds",
"chip": "esp32",
"appbin": "esp32/d32_pro-app.bin",
"esptool": {
"baudrate": "460800",
"options": "--before default_reset --after hard_reset",
"flashcmd": "write_flash -z"
},
"binfiles": [
{
"name": "esp32/d32_pro-bootloader.bin",
"offset": "0x1000"
},
{
"name": "esp32/d32_pro-partitions.bin",
"offset": "0x8000"
},
{
"name": "esp32/boot_app0.bin",
"offset": "0xe000"
},
{
"name": "esp32/d32_pro-app.bin",
"offset": "0x10000"
}
],
"filesystem": {
"page": "256",
"block": "4096",
"size": "0x30000",
"offset": "0x3D0000"
}
},
{
"name": "Generic ESP32 4MB",
"description": "Generic ESP32 with 4MB flash layout for DIY builds",
"chip": "esp32",
"appbin": "esp32/app.bin",
"appbin": "esp32/d1_mini32-app.bin",
"esptool": {
"baudrate": "460800",
"options": "--before default_reset --after hard_reset",
"flashcmd": "write_flash -z"
},
"binfiles": [
{
"name": "esp32/bootloader.bin",
"name": "esp32/d1_mini32-bootloader.bin",
"offset": "0x1000"
},
{
"name": "esp32/partitions.bin",
"name": "esp32/d1_mini32-partitions.bin",
"offset": "0x8000"
},
{
"name": "esp32/boot_app0.bin",
"offset": "0xe000"
},
{
"name": "esp32/app.bin",
"name": "esp32/d1_mini32-app.bin",
"offset": "0x10000"
}
],
Expand Down
143 changes: 97 additions & 46 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
name: ESPixelStick CI
on: [push, pull_request]
env:
# Platform versions - When the ESP32 core updates, update the compile sections for boot_app0.bin as well
ESP8266_PLAT: 'esp8266:[email protected]'
ESP8266_FQBN: 'esp8266:esp8266:generic:xtal=160,vt=flash,exception=disabled,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dio,eesz=4M2M,led=2,ip=hb2f,dbg=Disabled'
# When the ESP32 core updates, update the location of boot_app0.bin as well in the compile section.
ESP32_PLAT: 'esp32:[email protected]'

# ESP8266_FQBN: 'esp8266:esp8266:generic:xtal=160,vt=flash,exception=disabled,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=40,FlashMode=dio,eesz=4M2M,led=2,ip=hb2f,dbg=Disabled'
# ESP32_FQBN: 'esp32:esp32:d32_pro:PSRAM=enabled,PartitionScheme=default,FlashFreq=80,DebugLevel=none'
ESP32_FQBN: 'esp32:esp32:d1_mini32:PartitionScheme=min_spiffs,FlashFreq=80'
# ESP32_FQBN: 'esp32:esp32:d1_mini32:PartitionScheme=min_spiffs,FlashFreq=80'

jobs:
build:
firmware:
strategy:
matrix:
# target: ["d1_mini", "d32_pro", "d1_mini32"]
include:
# ESPixelStick V3 - Wemos D1 Mini ESP8266
- target: "d1_mini"
platform: $ESP8266_PLAT
chip: "esp8266"
fqbn: "esp8266:esp8266:d1_mini:xtal=160,eesz=4M2M,ip=hb2f"
# Wemos D1 Mini ESP32
- target: "d1_mini32"
platform: $ESP32_PLAT
chip: "esp32"
fqbn: "esp32:esp32:d1_mini32:PartitionScheme=min_spiffs"
# Lolin D32 Pro
- target: "d32_pro"
platform: $ESP32_PLAT
chip: "esp32"
fqbn: "esp32:esp32:d32_pro:PSRAM=enabled,PartitionScheme=min_spiffs"

runs-on: ubuntu-latest
steps:
# Set Release Archive Filename
- run: echo "ARCHFILE=ESPixelStick_CI-$(date +'%Y%m%d%H%M%S').zip" >> $GITHUB_ENV

# Checkout ESPixelStick
- uses: actions/checkout@v2

# Arduino stuff
- uses: arduino/setup-arduino-cli@v1

- name: Update board indexes and set paths
run: |
arduino-cli config init
arduino-cli config add board_manager.additional_urls https://arduino.esp8266.com/stable/package_esp8266com_index.json https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli config set directories.user ~/arduino
- name: Install platforms
run: |
arduino-cli core install $ESP8266_PLAT
arduino-cli core install $ESP32_PLAT
# Node Stuff
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install
- name: Install platform
run: |
arduino-cli core install ${{ matrix.platform }}
# Grab all the required libraries
# Checkout won't allow paths outside of our workspace, so we put them in alib and move later.
Expand All @@ -44,58 +57,69 @@ jobs:
repository: bblanchon/ArduinoJson
path: alib/ArduinoJson
ref: 6.x

- name: Checkout ESPAsyncE131
uses: actions/checkout@v2
with:
repository: forkineye/ESPAsyncE131
path: alib/ESPAsyncE131
- name: Checkout ESPAsyncTCP
uses: actions/checkout@v2
with:
repository: me-no-dev/ESPAsyncTCP
path: alib/ESPAsyncTCP
- name: Checkout ESPAsyncUDP
uses: actions/checkout@v2
with:
repository: me-no-dev/ESPAsyncUDP
path: alib/ESPAsyncUDP

- name: Checkout ESPAsyncWebServer
uses: actions/checkout@v2
with:
repository: me-no-dev/ESPAsyncWebServer
path: alib/ESPAsyncWebServer

- name: Checkout async-mqtt-client
uses: actions/checkout@v2
with:
repository: marvinroger/async-mqtt-client
path: alib/async-mqtt-client

- name: Checkout Int64String
uses: actions/checkout@v2
with:
repository: djGrrr/Int64String
path: alib/Int64String

- name: Checkout Espalexa
uses: actions/checkout@v2
with:
repository: MartinMueller2003/Espalexa
path: alib/Espalexa

- name: Checkout Adafruit PWM Servo Driver
uses: actions/checkout@v2
with:
repository: adafruit/Adafruit-PWM-Servo-Driver-Library
path: alib/Adafruit-PWM-Servo-Driver-Library

- name: Checkout Artnet
uses: actions/checkout@v2
with:
repository: natcl/Artnet
path: alib/Artnet

- name: Checkout ArduinoStreamUtils
uses: actions/checkout@v2
with:
repository: bblanchon/ArduinoStreamUtils
path: alib/ArduinoStreamUtils

# ESP32 Specific Stuff
# ESP8266 specific stuff
- name: Checkout ESPAsyncTCP
uses: actions/checkout@v2
with:
repository: me-no-dev/ESPAsyncTCP
path: alib/ESPAsyncTCP

- name: Checkout ESPAsyncUDP
uses: actions/checkout@v2
with:
repository: me-no-dev/ESPAsyncUDP
path: alib/ESPAsyncUDP

# ESP32 specific stuff
- name: Checkout AsyncTCP
uses: actions/checkout@v2
with:
Expand All @@ -111,44 +135,71 @@ jobs:
- name: Create secrets.h
run: |
echo '#define SECRETS_SSID "SSID_NOT_SET"' > src/secrets.h
echo '#define SECRETS_PASS "PASSPHRASE_NOT_SET"' >> src/secrets.h
echo '#define SECRETS_SSID "SSID_NOT_SET"' > ESPixelStick/src/secrets.h
echo '#define SECRETS_PASS "PASSPHRASE_NOT_SET"' >> ESPixelStick/src/secrets.h
# Build and move the binaries
- name: Compile for ESP8266
# Build and move / rename firmware files
# Make sure to update boot_app0.bin location when the ESP32 core updates
- name: Compile for ${{ matrix.target }}
env:
chip: ${{ matrix.chip }}
run: |
arduino-cli compile --fqbn $ESP8266_FQBN --build-path ~/build ESPixelStick
mkdir -p dist/firmware/esp8266
mv ~/build/ESPixelStick.ino.bin dist/firmware/esp8266/app.bin
arduino-cli compile --fqbn ${{ matrix.fqbn }} --build-path ~/build ESPixelStick
mkdir -p firmware/${{ matrix.chip }}
mv ~/build/ESPixelStick.ino.bin firmware/${{ matrix.chip }}/${{ matrix.target }}-app.bin
if [ "$chip" = "esp32" ]; then
mv ~/build/ESPixelStick.ino.bootloader.bin firmware/esp32/${{ matrix.target }}-bootloader.bin
mv ~/build/ESPixelStick.ino.partitions.bin firmware/esp32/${{ matrix.target }}-partitions.bin
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.0/tools/partitions/boot_app0.bin firmware/esp32/boot_app0.bin
fi
# Make sure to update boot_app0.bin location when the core updates
- name: Compile for ESP32
run: |
arduino-cli compile --fqbn $ESP32_FQBN --build-path ~/build ESPixelStick
mkdir -p dist/firmware/esp32
mv ~/build/ESPixelStick.ino.bin dist/firmware/esp32/app.bin
mv ~/build/ESPixelStick.ino.bootloader.bin dist/firmware/esp32/bootloader.bin
mv ~/build/ESPixelStick.ino.partitions.bin dist/firmware/esp32/partitions.bin
cp ~/.arduino15/packages/esp32/hardware/esp32/2.0.0/tools/partitions/boot_app0.bin dist/firmware/esp32/boot_app0.bin
- name: Upload Firmware Artifacts
uses: actions/upload-artifact@v2
with:
name: Firmware Binaries
path: firmware


package:
needs: firmware
runs-on: ubuntu-latest
steps:
# Set Release Archive Filename
- run: echo "ARCHFILE=ESPixelStick_CI-$(date +'%Y%m%d%H%M%S').zip" >> $GITHUB_ENV

# Checkout ESPixelStick
- uses: actions/checkout@v2

# Download firmware binary artifact
- uses: actions/download-artifact@v2
with:
name: Firmware Binaries
path: dist/firmware

# Install Node
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install

# Build and move the web pages
- name: Compile Web Pages
run: |
gulp
gulp md
gulp ci
mv data/* dist/fs
mv ESPixelStick/data/* dist/fs
- name: Move CI specific release files into place
run: |
mv .ci/firmware.json dist/firmware/firmware.json
- name: Create Release Archive
run: zip -r ../${{env.ARCHFILE}} *
run: zip -r ../${{ env.ARCHFILE }} *
working-directory: dist

- name: Upload Release Artifact
uses: actions/upload-artifact@v2
with:
name: Release Archive
path: ${{env.ARCHFILE}}
path: ${{ env.ARCHFILE }}
7 changes: 0 additions & 7 deletions .sublimelinterrc

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c974fad

Please sign in to comment.