Skip to content

Commit 77756d8

Browse files
authored
ci: Miscellaneous improvements (espressif#6132)
Cache downloaded tools. Cancel duplicate jobs. Use current repo when linking the core, this allows users to test their code when creating PRs against their forks (for instance an error in an example sketch will build successfully in a fork workflow.) Cache Arduino IDE. Add workflow_dispatch to be able to trigger the workflow manually.
1 parent c6e30e0 commit 77756d8

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

Diff for: .github/scripts/install-arduino-core-esp32.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
1515
pip install requests > /dev/null
1616
fi
1717

18-
if [ "$GITHUB_REPOSITORY" == "espressif/arduino-esp32" ]; then
18+
if [ ! -z "$GITHUB_REPOSITORY" ]; then
1919
echo "Linking Core..."
2020
ln -s $GITHUB_WORKSPACE esp32
2121
else

Diff for: .github/workflows/push.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
name: ESP32 Arduino CI
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- master
78
- release/*
89
pull_request:
910

11+
concurrency:
12+
group: build-${{github.event.pull_request.number || github.ref}}
13+
cancel-in-progress: true
14+
1015
jobs:
11-
16+
1217
# Ubuntu
1318
build-arduino-linux:
1419
name: Arduino ${{ matrix.chunk }} on ubuntu-latest
1520
runs-on: ubuntu-latest
1621
strategy:
1722
matrix:
1823
chunk: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
19-
24+
2025
steps:
2126
- uses: actions/checkout@v2
2227
- uses: actions/setup-python@v2
2328
with:
2429
python-version: '3.x'
30+
- name: Cache tools
31+
id: cache-linux
32+
uses: actions/cache@v2
33+
with:
34+
path: |
35+
./tools/dist
36+
~/arduino_ide
37+
key: ${{ runner.os }}-${{ hashFiles('package/package_esp32_index.template.json',
38+
'tools/get.py',
39+
'.github/scripts/install-arduino-ide.sh') }}
2540
- name: Build Sketches
2641
run: bash ./.github/scripts/on-push.sh ${{ matrix.chunk }} 15
2742

@@ -32,7 +47,7 @@ jobs:
3247
strategy:
3348
matrix:
3449
os: [windows-latest, macOS-latest]
35-
50+
3651
steps:
3752
- uses: actions/checkout@v2
3853
- uses: actions/setup-python@v2
@@ -48,7 +63,7 @@ jobs:
4863
strategy:
4964
matrix:
5065
os: [ubuntu-latest, windows-latest, macOS-latest]
51-
66+
5267
steps:
5368
- uses: actions/checkout@v2
5469
- uses: actions/setup-python@v2

0 commit comments

Comments
 (0)