Skip to content

Commit 5d5ff36

Browse files
authored
Implement build caching to accelerate compilation
- Add --build-cache-path flag to arduino-cli compile command. - Create /tmp/arduino-cache directory to store pre-compiled core objects. - Reduces total CI runtime by reusing compiled RP2040 core files across multiple examples.
1 parent f97a9e3 commit 5d5ff36

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

.github/workflows/compile-test.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@ jobs:
3030
3131
- name: Compile Examples
3232
run: |
33-
- name: Compile Examples
34-
run: |
35-
# Find every .ino file, get its directory (dirname), and compile that directory
33+
# Create the cache directory
34+
mkdir -p /tmp/arduino-cache
35+
36+
# Find every .ino file, get its directory, and compile with caching
3637
for example in $(find ./examples -name "*.ino"); do
3738
EXAMPLE_DIR=$(dirname "$example")
3839
echo "Compiling sketch in $EXAMPLE_DIR..."
39-
$HOME/bin/arduino-cli compile --fqbn rp2040:rp2040:rpipico "$EXAMPLE_DIR"
40+
41+
$HOME/bin/arduino-cli compile \
42+
--fqbn rp2040:rp2040:rpipico \
43+
--build-cache-path /tmp/arduino-cache \
44+
"$EXAMPLE_DIR"
4045
done
46+

0 commit comments

Comments
 (0)