Skip to content

Commit 8eda75b

Browse files
Consolidate duplicated test code
1 parent 21cb4fd commit 8eda75b

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

.github/workflows/pr-or-master-push.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,18 @@ jobs:
6565
./get.py -q
6666
- name: Build examples ESP8266
6767
run: |
68-
mkdir esp8266
69-
rm -f *.elf
70-
# Get initial list and shift off to the starting point
71-
sketches=$(find ~/Arduino/libraries/ESP8266Audio/examples -name "*.ino" | sort | tr '\n' ' ' | cut -f${{matrix.shift}} -d " ")
72-
while [ $(echo $sketches | wc -w) -gt 0 ]; do
73-
sketch=$(echo $sketches | cut -f1 -d " ")
74-
./tests/build-ci-esp32.sh esp8266com:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,optim=Smallest,wipe=none,baud=921600,iramfloat=no esp8266 $sketch
75-
# Shift out 5
76-
sketches=$(echo $sketches | cut -f6- -d " ")
77-
done
78-
size ./*.elf
68+
./tests/build-ci.sh esp8266 esp8266com:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,optim=Smallest,wipe=none,baud=921600,iramfloat=no ${{matrix.shift}}
69+
# mkdir esp8266
70+
# rm -f *.elf
71+
# # Get initial list and shift off to the starting point
72+
# sketches=$(find ~/Arduino/libraries/ESP8266Audio/examples -name "*.ino" | sort | tr '\n' ' ' | cut -f${{matrix.shift}} -d " ")
73+
# while [ $(echo $sketches | wc -w) -gt 0 ]; do
74+
# sketch=$(echo $sketches | cut -f1 -d " ")
75+
# ./tests/build-ci-esp32.sh esp8266com:esp8266:d1_mini:xtal=80,vt=flash,exception=disabled,stacksmash=disabled,ssl=all,mmu=3232,non32xfer=fast,eesz=4M2M,ip=lm2f,dbg=Disabled,lvl=None____,optim=Smallest,wipe=none,baud=921600,iramfloat=no esp8266 $sketch
76+
# # Shift out 5
77+
# sketches=$(echo $sketches | cut -f6- -d " ")
78+
# done
79+
# size ./*.elf
7980

8081
build-all-esp32:
8182
name: Build all examples on Arduino-ESP32 latest release

tests/build-ci.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
outdir=$1; shift
7+
offset=$1; shift
8+
fqbn=$1; shift
9+
10+
mkdir $outdir
11+
rm -f *.elf
12+
13+
# Get initial list and shift off to the starting point
14+
sketches=$(find ~/Arduino/libraries/ESP8266Audio/examples -name "*.ino" | sort | tr '\n' ' ' | cut -f$offset -d " ")
15+
16+
# Iterate over sketches
17+
while [ $(echo $sketches | wc -w) -gt 0 ]; do
18+
sketch=$(echo $sketches | cut -f1 -d " ")
19+
echo "::group::Compiling $(basename $sketch) for $fqbn into $outdir"
20+
./arduino-cli compile -b "$fqbn" -v --warnings all --build-path "$outdir" "$sketch" || exit 255
21+
mv -f "$outdir"/*.elf .
22+
echo "::endgroup::"
23+
# Shift out 5
24+
sketches=$(echo $sketches | cut -f6- -d " ")
25+
done
26+
27+
echo "::group::Final Sizes"
28+
size ./*.elf
29+
echo "::endgroup::"

0 commit comments

Comments
 (0)