Skip to content

Commit 50582e9

Browse files
committed
Update arduino_cron.yml
1 parent 328eed4 commit 50582e9

File tree

1 file changed

+27
-33
lines changed

1 file changed

+27
-33
lines changed

.github/workflows/arduino_cron.yml

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,12 @@ jobs:
100100
git clone --quiet https://github.com/pschatzmann/ESP32-A2DP /home/runner/Arduino/libraries/ESP32-A2DP
101101
git clone --quiet https://github.com/pschatzmann/arduino-audio-tools /home/runner/Arduino/libraries/arduino-audio-tools
102102
103-
- name: Configure build flags for FastLED
103+
- name: test platforms
104104
run: |
105-
echo "Checking for FastLED usage in repository..."
106-
107105
# Check if any sketch uses FastLED
108106
USES_FASTLED=false
109107
110-
# Find all .ino files and check for FastLED usage
108+
echo "Checking for FastLED usage in repository..."
111109
for sketch in $(find . -name "*.ino" -type f); do
112110
if grep -q "#include.*FastLED" "$sketch" 2>/dev/null || grep -q "include.*FastLED" "$sketch" 2>/dev/null; then
113111
echo "Found FastLED usage in: $sketch"
@@ -116,47 +114,43 @@ jobs:
116114
fi
117115
done
118116
119-
# If FastLED is used, create platform.local.txt files for ALL platforms
117+
# If FastLED is used, create platform.local.txt files
120118
if [ "$USES_FASTLED" = true ]; then
121-
echo "FastLED detected in repository, applying compile flag fix for all platforms"
119+
echo "FastLED detected, applying compile flag fix"
122120
123-
# Wait for Arduino CLI to be fully set up
124-
sleep 2
121+
# Debug: Show current Arduino package structure
122+
echo "Arduino package structure:"
123+
find ~/.arduino15/packages -name platform.txt -type f 2>/dev/null || echo "No platform.txt files found yet"
125124
126-
# Find all platform.txt files and create corresponding platform.local.txt
125+
# Create platform.local.txt in all possible Arduino package locations
126+
# This needs to happen right before the build
127127
if [ -d ~/.arduino15/packages ]; then
128-
for platform_file in $(find ~/.arduino15/packages -name platform.txt -type f); do
128+
for platform_file in $(find ~/.arduino15/packages -name platform.txt -type f 2>/dev/null); do
129129
dir=$(dirname "$platform_file")
130130
echo "compiler.cpp.extra_flags=-DFASTLED_USE_COMPILE_TESTS=0" > "$dir/platform.local.txt"
131131
echo "Created platform.local.txt in $dir"
132+
# Verify it was created
133+
ls -la "$dir/platform.local.txt"
132134
done
133135
fi
134136
135-
# Also check for Arduino cores in other possible locations
136-
ARDUINO_DIRS=(
137-
"$HOME/.arduino15"
138-
"$HOME/Arduino"
139-
"/usr/local/share/arduino"
140-
"/usr/share/arduino"
141-
)
137+
# Also try the home Arduino directory
138+
if [ -d "$HOME/Arduino/hardware" ]; then
139+
for platform_file in $(find "$HOME/Arduino/hardware" -name platform.txt -type f 2>/dev/null); do
140+
dir=$(dirname "$platform_file")
141+
echo "compiler.cpp.extra_flags=-DFASTLED_USE_COMPILE_TESTS=0" > "$dir/platform.local.txt"
142+
echo "Created platform.local.txt in $dir"
143+
ls -la "$dir/platform.local.txt"
144+
done
145+
fi
142146
143-
for arduino_dir in "${ARDUINO_DIRS[@]}"; do
144-
if [ -d "$arduino_dir/packages" ]; then
145-
for platform_file in $(find "$arduino_dir/packages" -name platform.txt -type f 2>/dev/null); do
146-
dir=$(dirname "$platform_file")
147-
if [ ! -f "$dir/platform.local.txt" ]; then
148-
echo "compiler.cpp.extra_flags=-DFASTLED_USE_COMPILE_TESTS=0" > "$dir/platform.local.txt"
149-
echo "Created platform.local.txt in $dir"
150-
fi
151-
done
152-
fi
153-
done
154-
else
155-
echo "No FastLED usage detected in repository"
147+
# Alternative approach: Set environment variable
148+
export ARDUINO_BUILD_FLAGS="-DFASTLED_USE_COMPILE_TESTS=0"
149+
echo "Also set ARDUINO_BUILD_FLAGS=$ARDUINO_BUILD_FLAGS"
156150
fi
157-
158-
- name: test platforms
159-
run: python3 ci/build_platform.py ${{ matrix.arduino-platform }}
151+
152+
# Now run the actual build
153+
python3 ci/build_platform.py ${{ matrix.arduino-platform }}
160154
161155
162156
- name: Upload build artifacts

0 commit comments

Comments
 (0)