Skip to content

Commit 70a8964

Browse files
authored
Update Both CIs to run parallel jobs (#3120)
1 parent 390da0d commit 70a8964

File tree

4 files changed

+131
-94
lines changed

4 files changed

+131
-94
lines changed

.github/workflows/main.yml

+7-57
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: ESP32 Arduino CI
22

3-
on: [pull_request]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- release/*
8+
pull_request:
49

510
jobs:
611

@@ -17,8 +22,7 @@ jobs:
1722

1823
- name: Install Arduino IDE
1924
env:
20-
ESP32_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21-
GITHUB_EVENT_NAME: ${{ github.event_name }}
25+
#ESP32_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2226
TRAVIS_BUILD_DIR: ${{ github.workspace }}
2327
run: ./tools/prep-arduino-ide.sh
2428
- name: Test Arduino IDE
@@ -36,9 +40,6 @@ jobs:
3640
- uses: actions/checkout@v1
3741
- name: Pull submodules
3842
run: git submodule update --init --recursive
39-
- name: Run CMake Check
40-
run: ./tools/check_cmakelists.sh
41-
4243
- name: Install Arduino IDE
4344
env:
4445
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -58,9 +59,6 @@ jobs:
5859
- uses: actions/checkout@v1
5960
- name: Pull submodules
6061
run: git submodule update --init --recursive
61-
- name: Run CMake Check
62-
run: ./tools/check_cmakelists.sh
63-
6462
- name: Install Arduino IDE
6563
env:
6664
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -80,9 +78,6 @@ jobs:
8078
- uses: actions/checkout@v1
8179
- name: Pull submodules
8280
run: git submodule update --init --recursive
83-
- name: Run CMake Check
84-
run: ./tools/check_cmakelists.sh
85-
8681
- name: Install Arduino IDE
8782
env:
8883
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -102,9 +97,6 @@ jobs:
10297
- uses: actions/checkout@v1
10398
- name: Pull submodules
10499
run: git submodule update --init --recursive
105-
- name: Run CMake Check
106-
run: ./tools/check_cmakelists.sh
107-
108100
- name: Install Arduino IDE
109101
env:
110102
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -124,9 +116,6 @@ jobs:
124116
- uses: actions/checkout@v1
125117
- name: Pull submodules
126118
run: git submodule update --init --recursive
127-
- name: Run CMake Check
128-
run: ./tools/check_cmakelists.sh
129-
130119
- name: Install Arduino IDE
131120
env:
132121
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -146,9 +135,6 @@ jobs:
146135
- uses: actions/checkout@v1
147136
- name: Pull submodules
148137
run: git submodule update --init --recursive
149-
- name: Run CMake Check
150-
run: ./tools/check_cmakelists.sh
151-
152138
- name: Install Arduino IDE
153139
env:
154140
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -168,9 +154,6 @@ jobs:
168154
- uses: actions/checkout@v1
169155
- name: Pull submodules
170156
run: git submodule update --init --recursive
171-
- name: Run CMake Check
172-
run: ./tools/check_cmakelists.sh
173-
174157
- name: Install Arduino IDE
175158
env:
176159
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -190,9 +173,6 @@ jobs:
190173
- uses: actions/checkout@v1
191174
- name: Pull submodules
192175
run: git submodule update --init --recursive
193-
- name: Run CMake Check
194-
run: ./tools/check_cmakelists.sh
195-
196176
- name: Install Arduino IDE
197177
env:
198178
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -212,9 +192,6 @@ jobs:
212192
- uses: actions/checkout@v1
213193
- name: Pull submodules
214194
run: git submodule update --init --recursive
215-
- name: Run CMake Check
216-
run: ./tools/check_cmakelists.sh
217-
218195
- name: Install Arduino IDE
219196
env:
220197
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -234,9 +211,6 @@ jobs:
234211
- uses: actions/checkout@v1
235212
- name: Pull submodules
236213
run: git submodule update --init --recursive
237-
- name: Run CMake Check
238-
run: ./tools/check_cmakelists.sh
239-
240214
- name: Install Arduino IDE
241215
env:
242216
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -256,9 +230,6 @@ jobs:
256230
- uses: actions/checkout@v1
257231
- name: Pull submodules
258232
run: git submodule update --init --recursive
259-
- name: Run CMake Check
260-
run: ./tools/check_cmakelists.sh
261-
262233
- name: Install Arduino IDE
263234
env:
264235
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -278,9 +249,6 @@ jobs:
278249
- uses: actions/checkout@v1
279250
- name: Pull submodules
280251
run: git submodule update --init --recursive
281-
- name: Run CMake Check
282-
run: ./tools/check_cmakelists.sh
283-
284252
- name: Install Arduino IDE
285253
env:
286254
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -300,9 +268,6 @@ jobs:
300268
- uses: actions/checkout@v1
301269
- name: Pull submodules
302270
run: git submodule update --init --recursive
303-
- name: Run CMake Check
304-
run: ./tools/check_cmakelists.sh
305-
306271
- name: Install Arduino IDE
307272
env:
308273
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -322,9 +287,6 @@ jobs:
322287
- uses: actions/checkout@v1
323288
- name: Pull submodules
324289
run: git submodule update --init --recursive
325-
- name: Run CMake Check
326-
run: ./tools/check_cmakelists.sh
327-
328290
- name: Install Arduino IDE
329291
env:
330292
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -344,9 +306,6 @@ jobs:
344306
- uses: actions/checkout@v1
345307
- name: Pull submodules
346308
run: git submodule update --init --recursive
347-
- name: Run CMake Check
348-
run: ./tools/check_cmakelists.sh
349-
350309
- name: Install Arduino IDE
351310
env:
352311
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -366,9 +325,6 @@ jobs:
366325
- uses: actions/checkout@v1
367326
- name: Pull submodules
368327
run: git submodule update --init --recursive
369-
- name: Run CMake Check
370-
run: ./tools/check_cmakelists.sh
371-
372328
- name: Install Arduino IDE
373329
env:
374330
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -388,9 +344,6 @@ jobs:
388344
- uses: actions/checkout@v1
389345
- name: Pull submodules
390346
run: git submodule update --init --recursive
391-
- name: Run CMake Check
392-
run: ./tools/check_cmakelists.sh
393-
394347
- name: Install Arduino IDE
395348
env:
396349
TRAVIS_BUILD_DIR: ${{ github.workspace }}
@@ -411,9 +364,6 @@ jobs:
411364
- uses: actions/checkout@v1
412365
- name: Pull submodules
413366
run: git submodule update --init --recursive
414-
- name: Run CMake Check
415-
run: ./tools/check_cmakelists.sh
416-
417367
- name: Install Python Wheel
418368
run: pip install wheel
419369
- name: Install GCC Toolchain

.travis.yml

+62-11
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,73 @@ os:
1010
git:
1111
depth: false
1212

13-
env:
14-
global:
13+
# new script start
14+
before_install:
15+
- git submodule update --init --recursive
16+
17+
stages:
18+
- build
19+
- deploy
20+
21+
jobs:
22+
include:
23+
24+
- name: "Build Arduino 0"
25+
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
26+
stage: build
27+
script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 0 4
28+
29+
- name: "Build Arduino 1"
30+
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
31+
stage: build
32+
script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 1 4
33+
34+
- name: "Build Arduino 2"
35+
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
36+
stage: build
37+
script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 2 4
38+
39+
- name: "Build Arduino 3"
40+
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
41+
stage: build
42+
script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 3 4
43+
44+
- name: "Build PlatformIO"
45+
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
46+
stage: build
47+
script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 4 4
48+
49+
- name: "Package & Deploy"
50+
if: tag IS present
51+
stage: deploy
52+
script: bash $TRAVIS_BUILD_DIR/tools/build-release.sh
53+
env:
1554
- secure: "l/4Dt+KQ/mACtGAHDUsPr66fUte840PZoQ4xpPikqWZI0uARu4l+Ym7+sHinnT6fBqrj8AJeBYGz4nFa8NK4LutZn9mSD40w+sxl0wSV4oHV8rzKe3Cd8+sMG3+o33yWoikMNjSvqa73Q0rm+SgrlInNdZbuAyixL+a2alaWSnGPm4F2xwUGj+S33TOy5P/Xp77CYtCV5S8vzyk/eEdNhoF0GYePJVdfuzCOUjXMyT5OWxORkzzQ7Hnn/Ka/RDfV8Si4HgujLQBrK5q6iPnNBFqBSqilYBepSMn4opnOBpIm0SCgePz7XQEFC83buA7GUcnCnfg38bf+dCwHaODf1d1PmqVRYt2QmfinexXtM4afAtL0iBUDtvrfnXHzwW9w82VeZhpbJSVh9DUQvB0IlsZeCz9J9PUBAi3N+SMX+9l+BomYwRUlPuKY+Ef2JKk9q6mxtUkky5R0daAlVxEhpVdQks1rT+T+NMoDMemxQ3SKEiqAHh6EgHecruszffmZ71uLX9MpERpew0qN+UFiafws+jkTjx+3yF9yut0Hf9sMbeAYzzkGzRqJTUEBJ6B29Cql8M0yRXCNN/8wuuTHhG8esstozga4ZQoIVrq7mEAgup376PTcNfr1+imbbWVQ7lJdYIuDe6OS5V3OX6np11vgK/DbhfyzvQv9Z1zAGnM="
1655
- REMOTE_URL=https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG
17-
18-
script:
19-
- bash $TRAVIS_BUILD_DIR/tools/build.sh
56+
before_deploy: git submodule update --init
57+
deploy:
58+
- provider: script
59+
skip_cleanup: true
60+
script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease
61+
on:
62+
tags: true
2063

21-
deploy:
22-
provider: script
23-
skip_cleanup: true
24-
script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease
64+
# old script start
65+
# env:
66+
# global:
67+
# - secure: "l/4Dt+KQ/mACtGAHDUsPr66fUte840PZoQ4xpPikqWZI0uARu4l+Ym7+sHinnT6fBqrj8AJeBYGz4nFa8NK4LutZn9mSD40w+sxl0wSV4oHV8rzKe3Cd8+sMG3+o33yWoikMNjSvqa73Q0rm+SgrlInNdZbuAyixL+a2alaWSnGPm4F2xwUGj+S33TOy5P/Xp77CYtCV5S8vzyk/eEdNhoF0GYePJVdfuzCOUjXMyT5OWxORkzzQ7Hnn/Ka/RDfV8Si4HgujLQBrK5q6iPnNBFqBSqilYBepSMn4opnOBpIm0SCgePz7XQEFC83buA7GUcnCnfg38bf+dCwHaODf1d1PmqVRYt2QmfinexXtM4afAtL0iBUDtvrfnXHzwW9w82VeZhpbJSVh9DUQvB0IlsZeCz9J9PUBAi3N+SMX+9l+BomYwRUlPuKY+Ef2JKk9q6mxtUkky5R0daAlVxEhpVdQks1rT+T+NMoDMemxQ3SKEiqAHh6EgHecruszffmZ71uLX9MpERpew0qN+UFiafws+jkTjx+3yF9yut0Hf9sMbeAYzzkGzRqJTUEBJ6B29Cql8M0yRXCNN/8wuuTHhG8esstozga4ZQoIVrq7mEAgup376PTcNfr1+imbbWVQ7lJdYIuDe6OS5V3OX6np11vgK/DbhfyzvQv9Z1zAGnM="
68+
# - REMOTE_URL=https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG
69+
70+
# script:
71+
# - bash $TRAVIS_BUILD_DIR/tools/build.sh
2572

26-
on:
27-
tags: true
73+
# deploy:
74+
# provider: script
75+
# skip_cleanup: true
76+
# script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease
2877

78+
# on:
79+
# tags: true
2980

3081
notifications:
3182
email:

tools/build-release.sh

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
#!/bin/bash
22

3+
if [ -z "$TRAVIS_TAG" ]; then
4+
echo "Skipping Packaging: Regular build"
5+
exit 0
6+
fi
7+
38
############################################################
49
# $1 - download link
510
# $2 - JSON output file

tools/build-tests.sh

+57-26
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,64 @@
11
#!/bin/bash
22

3-
# CMake Test
4-
echo -e "travis_fold:start:check_cmakelists"
5-
tools/check_cmakelists.sh
6-
if [ $? -ne 0 ]; then exit 1; fi
7-
echo -e "travis_fold:end:check_cmakelists"
3+
if [ ! -z "$TRAVIS_TAG" ]; then
4+
echo "Skipping Test: Tagged build"
5+
exit 0
6+
fi
7+
8+
CHUNK_INDEX=$1
9+
CHUNKS_CNT=$2
10+
BUILD_PIO=0
11+
if [ "$#" -lt 2 ]; then
12+
echo "Building all sketches"
13+
CHUNK_INDEX=0
14+
CHUNKS_CNT=1
15+
BUILD_PIO=1
16+
fi
17+
if [ "$CHUNKS_CNT" -le 0 ]; then
18+
CHUNK_INDEX=0
19+
CHUNKS_CNT=1
20+
BUILD_PIO=1
21+
fi
22+
if [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ]; then
23+
CHUNK_INDEX=$CHUNKS_CNT
24+
fi
25+
if [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
26+
BUILD_PIO=1
27+
fi
828

9-
# ArduinoIDE Test
10-
echo -e "travis_fold:start:prep_arduino_ide"
11-
tools/prep-arduino-ide.sh
12-
if [ $? -ne 0 ]; then exit 1; fi
13-
echo -e "travis_fold:end:prep_arduino_ide"
29+
# CMake Test
30+
if [ "$CHUNK_INDEX" -eq 0 ]; then
31+
echo -e "travis_fold:start:check_cmakelists"
32+
tools/check_cmakelists.sh
33+
if [ $? -ne 0 ]; then exit 1; fi
34+
echo -e "travis_fold:end:check_cmakelists"
35+
fi
1436

15-
echo -e "travis_fold:start:test_arduino_ide"
16-
tools/test-arduino-ide.sh
17-
if [ $? -ne 0 ]; then exit 1; fi
18-
echo -e "travis_fold:end:test_arduino_ide"
37+
if [ "$BUILD_PIO" -eq 0 ]; then
38+
# ArduinoIDE Test
39+
echo -e "travis_fold:start:prep_arduino_ide"
40+
tools/prep-arduino-ide.sh
41+
if [ $? -ne 0 ]; then exit 1; fi
42+
echo -e "travis_fold:end:prep_arduino_ide"
1943

20-
echo -e "travis_fold:start:size_report"
21-
cat size.log
22-
echo -e "travis_fold:end:size_report"
44+
echo -e "travis_fold:start:test_arduino_ide"
45+
tools/test-arduino-ide.sh $CHUNK_INDEX $CHUNKS_CNT
46+
if [ $? -ne 0 ]; then exit 1; fi
47+
echo -e "travis_fold:end:test_arduino_ide"
2348

24-
# PlatformIO Test
25-
echo -e "travis_fold:start:prep_platformio"
26-
tools/prep-platformio.sh
27-
if [ $? -ne 0 ]; then exit 1; fi
28-
echo -e "travis_fold:end:prep_platformio"
49+
echo -e "travis_fold:start:size_report"
50+
cat size.log
51+
echo -e "travis_fold:end:size_report"
52+
else
53+
# PlatformIO Test
54+
echo -e "travis_fold:start:prep_platformio"
55+
cd tools && python get.py && cd ..
56+
tools/prep-platformio.sh
57+
if [ $? -ne 0 ]; then exit 1; fi
58+
echo -e "travis_fold:end:prep_platformio"
2959

30-
echo -e "travis_fold:start:test_platformio"
31-
tools/test-platformio.sh
32-
if [ $? -ne 0 ]; then exit 1; fi
33-
echo -e "travis_fold:end:test_platformio"
60+
echo -e "travis_fold:start:test_platformio"
61+
tools/test-platformio.sh
62+
if [ $? -ne 0 ]; then exit 1; fi
63+
echo -e "travis_fold:end:test_platformio"
64+
fi

0 commit comments

Comments
 (0)