From 6efbd2035321237a9f1ff22a77ec4ad154ca8cb5 Mon Sep 17 00:00:00 2001 From: WongXXgmail Date: Fri, 10 Jan 2025 15:31:20 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20.gitea/workflows/esp32test?= =?UTF-8?q?.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/esp32test.yml | 59 ++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .gitea/workflows/esp32test.yml diff --git a/.gitea/workflows/esp32test.yml b/.gitea/workflows/esp32test.yml new file mode 100644 index 0000000..2865215 --- /dev/null +++ b/.gitea/workflows/esp32test.yml @@ -0,0 +1,59 @@ +name: 編譯測試 + +on: + push: + paths: + - "*.c" + - "*.cpp" + - "*.h" + - "*.hpp" + - "*.ino" + - ".gitea/workflows/esp32test.yml" + pull_request: + paths: + - "*.c" + - "*.cpp" + - "*.h" + - "*.hpp" + - "*.ino" + +env: + additionalurls: https://espressif.github.io/arduino-esp32/package_esp32_index.json + +jobs: + TestBuild: + runs-on: ubuntu-latest + steps: + - name: 拉取草稿碼 + uses: actions/checkout@master + - name: 安裝Arduino編譯器 + uses: arduino/setup-arduino-cli@v1.0.0 + - name: 設定Arduino + run: | + arduino-cli config init + arduino-cli config set library.enable_unsafe_install true + - name: 下載平台json + run: curl $additionalurls -o /root/additional.json + - name: 獲取緩存 + uses: actions/cache@v3 + id: esp32tool-cache + with: + path: /root/.arduino15/packages + key: ${{ runner.os }}-esp32tool-${{ hashFiles("/root/additional.json") }} + restore-keys: ${{ runner.os }}-esp32tool- + - name: 安裝平台 + run: | + if [ -d "/root/.arduino15/packages/esp32" ]; then + echo "平台已被安裝 跳過安裝" + else + arduino-cli core update-index + arduino-cli core install esp32:esp32 --additional-urls $additionalurls + fi + - name: 安裝庫 + run: | + arduino-cli lib install "Adafruit ILI9341@1.6.1" + arduino-cli lib install "NTPClient@3.2.1" + arduino-cli lib install "TFT_eSPI@2.5.43" + arduino-cli lib install --git-url https://github.com/Bodmer/TFT_Touch.git + - name: 編譯測試 + run: arduino-cli compile --fqbn esp32:esp32:esp32s3:JTAGAdapter=default ./blink