Skip to content

Commit 9e2a045

Browse files
authored
Migrate CI to arduino cli actions (#46)
Use arduino cli actions rather then own scripts
1 parent 8519f0b commit 9e2a045

File tree

3 files changed

+21
-358
lines changed

3 files changed

+21
-358
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 166 deletions
Original file line numberDiff line numberDiff line change
@@ -14,183 +14,38 @@ on:
1414

1515
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1616
jobs:
17-
18-
prepare_example_json:
19-
runs-on: ubuntu-latest
20-
steps:
21-
- uses: actions/checkout@v4
22-
23-
- name: generate examples
24-
id: set-matrix
25-
run: |
26-
source $GITHUB_WORKSPACE/travis/common.sh
27-
cd $GITHUB_WORKSPACE
28-
29-
echo -en "matrix=" >> $GITHUB_OUTPUT
30-
echo -en "[" >> $GITHUB_OUTPUT
31-
32-
get_sketches_json_matrix arduino $GITHUB_WORKSPACE/examples esp8266 0.35.3 esp8266:esp8266:generic:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=80,FlashMode=qio,eesz=4M2M,led=2,sdk=nonosdk_190703,ip=lm2f,dbg=Serial1,lvl=SSL,wipe=none,baud=115200 >> $GITHUB_OUTPUT
33-
echo -en "," >> $GITHUB_OUTPUT
34-
35-
get_sketches_json_matrix arduino $GITHUB_WORKSPACE/examples esp8266 0.35.3 esp8266:esp8266:generic:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,ResetMethod=nodemcu,CrystalFreq=26,FlashFreq=80,FlashMode=qio,eesz=4M2M,led=2,sdk=nonosdk_190703,ip=lm2f,dbg=Disabled,lvl=None____,wipe=none,baud=115200 >> $GITHUB_OUTPUT
36-
echo -en "," >> $GITHUB_OUTPUT
37-
38-
get_sketches_json_matrix arduino $GITHUB_WORKSPACE/examples esp32 0.35.3 esp32:esp32:esp32:FlashFreq=80 >> $GITHUB_OUTPUT
39-
40-
echo -en "]" >> $GITHUB_OUTPUT
41-
echo >> $GITHUB_OUTPUT
42-
outputs:
43-
matrix: ${{ steps.set-matrix.outputs.matrix }}
44-
45-
prepare_ide:
46-
runs-on: ubuntu-latest
47-
strategy:
48-
fail-fast: false
49-
matrix:
50-
CLI_VERSION: [0.35.3]
51-
env:
52-
CLI_VERSION: ${{ matrix.CLI_VERSION }}
53-
ARDUINO_DIRECTORIES_DATA: /home/runner/arduino_ide
54-
55-
steps:
56-
- uses: actions/checkout@v4
57-
58-
- name: Get hash
59-
id: get-hash
60-
run: |
61-
echo "hash=$(/bin/date -u "+%Y%m%d")-$(md5sum ".github/workflows/main.yml" | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
62-
shell: bash
63-
64-
- uses: actions/cache@v4
65-
id: cache_all
66-
with:
67-
path: |
68-
/home/runner/arduino_ide
69-
/home/runner/Arduino
70-
key: ${{ runner.os }}-${{ steps.get-hash.outputs.hash }}-${{ matrix.CLI_VERSION }}-cli
71-
72-
- name: download IDE
73-
if: steps.cache_all.outputs.cache-hit != 'true'
74-
run: |
75-
wget https://github.com/arduino/arduino-cli/releases/download/v${CLI_VERSION}/arduino-cli_${CLI_VERSION}_Linux_64bit.tar.gz -q
76-
tar xf arduino-cli_${CLI_VERSION}_Linux_64bit.tar.gz
77-
mkdir -p $ARDUINO_DIRECTORIES_DATA
78-
mv arduino-cli $ARDUINO_DIRECTORIES_DATA/
79-
80-
- name: download cores
81-
if: steps.cache_all.outputs.cache-hit != 'true'
82-
run: |
83-
export PATH="$ARDUINO_DIRECTORIES_DATA:$PATH"
84-
source $GITHUB_WORKSPACE/travis/common.sh
85-
get_core_cli
86-
87-
- name: download ArduinoJson
88-
if: steps.cache_all.outputs.cache-hit != 'true'
89-
run: |
90-
mkdir -p $HOME/Arduino/libraries
91-
wget https://github.com/bblanchon/ArduinoJson/archive/6.x.zip -q
92-
unzip 6.x.zip
93-
mv ArduinoJson-6.x $HOME/Arduino/libraries/ArduinoJson
94-
95-
- name: download Adafruit-GFX-Library
96-
if: steps.cache_all.outputs.cache-hit != 'true'
97-
run: |
98-
source $GITHUB_WORKSPACE/travis/common.sh
99-
clone_library https://github.com/adafruit/Adafruit-GFX-Library
100-
101-
- name: download Adafruit_BusIO
102-
if: steps.cache_all.outputs.cache-hit != 'true'
103-
run: |
104-
source $GITHUB_WORKSPACE/travis/common.sh
105-
clone_library https://github.com/adafruit/Adafruit_BusIO.git
106-
107-
- name: download XPT2046
108-
if: steps.cache_all.outputs.cache-hit != 'true'
109-
run: |
110-
source $GITHUB_WORKSPACE/travis/common.sh
111-
clone_library https://github.com/Links2004/XPT2046
112-
113-
- name: download Adafruit_ILI9341
114-
if: steps.cache_all.outputs.cache-hit != 'true'
115-
run: |
116-
source $GITHUB_WORKSPACE/travis/common.sh
117-
clone_library https://github.com/Links2004/Adafruit_ILI9341
118-
119-
- name: download TFT_eSPI
120-
if: steps.cache_all.outputs.cache-hit != 'true'
121-
run: |
122-
source $GITHUB_WORKSPACE/travis/common.sh
123-
clone_library https://github.com/Bodmer/TFT_eSPI
124-
125-
- name: download LovyanGFX
126-
if: steps.cache_all.outputs.cache-hit != 'true'
127-
run: |
128-
source $GITHUB_WORKSPACE/travis/common.sh
129-
clone_library https://github.com/lovyan03/LovyanGFX
130-
13117
build:
132-
needs: [prepare_ide, prepare_example_json]
13318
runs-on: ubuntu-latest
13419
strategy:
13520
fail-fast: false
13621
matrix:
137-
include: ${{ fromJson(needs.prepare_example_json.outputs.matrix) }}
138-
env:
139-
CPU: ${{ matrix.cpu }}
140-
BOARD: ${{ matrix.board }}
141-
IDE_VERSION: ${{ matrix.ideversion }}
142-
SKETCH: ${{ matrix.sketch }}
143-
ARDUINO_DIRECTORIES_DATA: /home/runner/arduino_ide
22+
platform: ["esp32:esp32:esp32", "esp8266:esp8266:nodemcuv2"]
23+
example: ["examples/VNC_ILI9341", "examples/VNC_ILI9341_touch", "examples/VNC_ST7789", "examples/VNC_ST7796_LovyanGFX"]
24+
exclude:
25+
- platform: "esp32:esp32:esp32"
26+
example: "examples/VNC_ILI9341_touch"
14427

14528
# Steps represent a sequence of tasks that will be executed as part of the job
14629
steps:
14730
- uses: actions/checkout@v4
148-
149-
- name: install libgtk2.0-0
150-
run: |
151-
sudo apt-get install -y libgtk2.0-0
152-
153-
- name: Get hash
154-
id: get-hash
155-
run: |
156-
echo "hash=$(/bin/date -u "+%Y%m%d")-$(md5sum ".github/workflows/main.yml" | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
157-
shell: bash
158-
159-
- uses: actions/cache@v4
160-
id: cache_all
31+
- uses: arduino/compile-sketches@v1
16132
with:
162-
path: |
163-
/home/runner/arduino_ide
164-
/home/runner/Arduino
165-
key: ${{ runner.os }}-${{ steps.get-hash.outputs.hash }}-${{ matrix.cliversion }}-cli
166-
167-
- name: install python serial
168-
if: matrix.cpu == 'esp32'
169-
run: |
170-
sudo pip3 install pyserial
171-
sudo pip install pyserial
172-
173-
- name: test IDE
174-
run: |
175-
export PATH="$ARDUINO_DIRECTORIES_DATA:$PATH"
176-
which arduino-cli
177-
178-
- name: copy code
179-
run: |
180-
mkdir -p $HOME/Arduino/libraries/
181-
cp -r $GITHUB_WORKSPACE $HOME/Arduino/libraries/arduinoVNC
182-
183-
- name: build example
184-
timeout-minutes: 20
185-
run: |
186-
set -ex
187-
export PATH="$HOME/arduino_ide:$PATH"
188-
source $GITHUB_WORKSPACE/travis/common.sh
189-
cd $GITHUB_WORKSPACE
190-
build_sketch_cli "$SKETCH" "$BOARD"
191-
33+
fqbn: ${{ matrix.platform }}
34+
platforms: |
35+
- name: "esp32:esp32"
36+
- source-url: http://arduino.esp8266.com/stable/package_esp8266com_index.json
37+
name: "esp8266:esp8266"
38+
libraries: |
39+
- source-path: ./
40+
- source-url: https://github.com/adafruit/Adafruit-GFX-Library.git
41+
- source-url: https://github.com/adafruit/Adafruit_BusIO.git
42+
- source-url: https://github.com/Links2004/XPT2046.git
43+
- source-url: https://github.com/Links2004/Adafruit_ILI9341.git
44+
- source-url: https://github.com/Bodmer/TFT_eSPI.git
45+
- source-url: https://github.com/lovyan03/LovyanGFX.git
46+
sketch-paths: ${{ matrix.example }}
19247
done:
193-
needs: [prepare_ide, prepare_example_json, build]
48+
needs: build
19449
runs-on: ubuntu-latest
19550
steps:
19651
- name: Done

.travis.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

travis/common.sh

Lines changed: 0 additions & 159 deletions
This file was deleted.

0 commit comments

Comments
 (0)