diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac63c39..0908715 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: build: # Platform GitHub will use to run workflow, we pick Windows for no particular reason - runs-on: windows-latest + runs-on: ubuntu-latest # Make sure Arduino CLI allows to install libraries with --git-url env: @@ -24,31 +24,29 @@ jobs: # Clone the repo using the `checkout` action - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true + + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platforio/.cache + key: ${{ runner.os }}-pio - # Install and configure Arduino CLI - - name: Setup Arduino CLI - uses: arduino/setup-arduino-cli@v1 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install PlatformIO Core + run: pip install --upgrade platformio # Install the platform and dependencies - - name: Install platform - run: | - arduino-cli core update-index --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json - arduino-cli core install esp8266:esp8266@2.7.4 --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json - arduino-cli lib install ArduinoJson - arduino-cli lib install FastLED - arduino-cli lib install AceButton - arduino-cli lib install --git-url https://github.com/me-no-dev/ESPAsyncTCP.git - arduino-cli lib install --git-url https://github.com/me-no-dev/ESPAsyncWebServer.git - - # Compile the sketch - - name: Compile Sketch - run: arduino-cli compile --fqbn "esp8266:esp8266:d1_mini:xtal=160,vt=flash,exception=legacy,ssl=all,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600" --export-binaries ./code - + - name: Build PlatformIO Project + run: pio run + # Create a release with binary file - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: - files: code/build/esp8266.esp8266.d1_mini/code.ino.bin \ No newline at end of file + files: .pio/build/d1_mini/firmware.bin \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index dd6be38..07603f3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,45 +14,37 @@ on: jobs: # Name of the job test: - - # Platform GitHub will use to run workflow, we pick Windows for no particular reason - runs-on: windows-latest - - # Make sure Arduino CLI allows to install libraries with --git-url - env: - ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL: true + # Based on example in platformio docs + runs-on: ubuntu-latest # List of steps this job will run steps: # Clone the repo using the `checkout` action - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true + + - uses: actions/cache@v4 + with: + path: | + ~/.cache/pip + ~/.platforio/.cache + key: ${{ runner.os }}-pio - # Install and configure Arduino CLI - - name: Setup Arduino CLI - uses: arduino/setup-arduino-cli@v1 + - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install PlatformIO Core + run: pip install --upgrade platformio # Install the platform and dependencies - - name: Install platform - run: | - arduino-cli core update-index --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json - arduino-cli core install esp8266:esp8266@2.7.4 --additional-urls https://arduino.esp8266.com/stable/package_esp8266com_index.json - arduino-cli lib install ArduinoJson - arduino-cli lib install FastLED - arduino-cli lib install AceButton - arduino-cli lib install --git-url https://github.com/me-no-dev/ESPAsyncTCP.git - arduino-cli lib install --git-url https://github.com/me-no-dev/ESPAsyncWebServer.git - - # Compile the sketch - - name: Compile Sketch - run: | - arduino-cli compile --fqbn "esp8266:esp8266:d1_mini:xtal=160,vt=flash,exception=legacy,ssl=all,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=921600" --export-binaries ./code + - name: Build PlatformIO Project + run: pio run # Upload binary files as artifacts - name: Upload artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - path: code/build/esp8266.esp8266.d1_mini/code.ino.bin + path: .pio/build/d1_mini/firmware.bin diff --git a/src/config.cpp b/src/Config.cpp similarity index 100% rename from src/config.cpp rename to src/Config.cpp diff --git a/src/config.h b/src/Config.h similarity index 100% rename from src/config.h rename to src/Config.h