From 17df96ed680f609b351b3f2a2c693dbd6844c31f Mon Sep 17 00:00:00 2001 From: lumapu Date: Sun, 7 Jan 2024 12:18:40 +0100 Subject: [PATCH] github action test --- .github/workflows/compile_development.yml | 102 +++++++++++++++++----- src/utils/helper.cpp | 2 +- 2 files changed, 79 insertions(+), 25 deletions(-) diff --git a/.github/workflows/compile_development.yml b/.github/workflows/compile_development.yml index 4b688fca..37d3950b 100644 --- a/.github/workflows/compile_development.yml +++ b/.github/workflows/compile_development.yml @@ -5,14 +5,85 @@ on: branches: development* paths-ignore: - '**.md' # Do no build on *.md changes + jobs: - build: + check: runs-on: ubuntu-latest + if: github.repository == 'lumapu/ahoy' && github.ref_name == 'development03' + continue-on-error: true + steps: + - uses: actions/checkout@v3 + build-en: + needs: check + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + variant: + - esp8266 + - esp8266-prometheus + - esp8285 + - esp32-wroom32 + - esp32-wroom32-prometheus + - esp32-wroom32-ethernet + - esp32-s2-mini + - esp32-c3-mini + - opendtufusion + - opendtufusion-ethernet steps: - uses: actions/checkout@v3 + - uses: benjlevesque/short-sha@v2.1 + id: short-sha + with: + length: 7 + + - name: Cache Pip + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Cache PlatformIO + uses: actions/cache@v3 with: - ref: development03 + path: ~/.platformio + key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} + + - name: Setup Python + uses: actions/setup-python@v4.3.0 + with: + python-version: "3.x" + + - name: Install PlatformIO + run: | + python -m pip install setuptools --upgrade pip + pip install --upgrade platformio + + - name: Run PlatformIO + run: pio run -d src -e ${{ matrix.variant }} + + build-de: + needs: check + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + variant: + - esp8266-de + - esp8266-prometheus-de + - esp8285-de + - esp32-wroom32-de + - esp32-wroom32-prometheus-de + - esp32-wroom32-ethernet-de + - esp32-s2-mini-de + - esp32-c3-mini-de + - opendtufusion-de + - opendtufusion-ethernet-de + steps: + - uses: actions/checkout@v3 - uses: benjlevesque/short-sha@v2.1 id: short-sha with: @@ -43,29 +114,12 @@ jobs: pip install --upgrade platformio - name: Run PlatformIO - run: > - pio run -d src - --environment esp8266 - --environment esp8266-prometheus - --environment esp8285 - --environment esp32-wroom32 - --environment esp32-wroom32-prometheus - --environment esp32-wroom32-ethernet - --environment esp32-s2-mini - --environment esp32-c3-mini - --environment opendtufusion - --environment opendtufusion-ethernet - --environment esp8266-de - --environment esp8266-prometheus-de - --environment esp8285-de - --environment esp32-wroom32-de - --environment esp32-wroom32-prometheus-de - --environment esp32-wroom32-ethernet-de - --environment esp32-s2-mini-de - --environment esp32-c3-mini-de - --environment opendtufusion-de - --environment opendtufusion-ethernet-de + run: pio run -d src -e ${{ matrix.variant }} + deploy: + needs: [build-en, build-de] + runs-on: ubuntu-latest + steps: - name: Copy boot_app0.bin run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin diff --git a/src/utils/helper.cpp b/src/utils/helper.cpp index 9aea1054..5d68adc4 100644 --- a/src/utils/helper.cpp +++ b/src/utils/helper.cpp @@ -76,7 +76,7 @@ namespace ah { sprintf(str, "n/a"); else { t = (t + (millis() % 1000)) / 1000; - sprintf(str, "%02d:%02d:%02d.%03d", hour(t), minute(t), second(t), millis() % 1000); + sprintf(str, "%02d:%02d:%02d.%03d", hour(t), minute(t), second(t), (uint16_t)(millis() % 1000)); } return String(str); }