This commit is contained in:
59
.gitea/workflows/esp32test.yml
Normal file
59
.gitea/workflows/esp32test.yml
Normal file
@ -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
|
Reference in New Issue
Block a user