Skip to content

Commit 54f6ad0

Browse files
committed
expect $HOME in .sh, not from workflow
currently, expansion does not happen and it is raw path $(pwd)/'${HOME}'/...
1 parent f00f566 commit 54f6ad0

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

.github/workflows/build-ide.yml

-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ jobs:
111111
- name: Build Sketches
112112
env:
113113
ESP8266_ARDUINO_BUILDER: "arduino"
114-
ESP8266_ARDUINO_HARDWARE: ${HOME}/Documents/Arduino/hardware
115-
ESP8266_ARDUINO_LIBRARIES: ${HOME}/Documents/Arduino/libraries
116114
ESP8266_ARDUINO_LWIP: ${{ matrix.lwip }}
117115
run: |
118116
bash ./tests/build.sh 8 ${{ matrix.chunk }}

tests/build.sh

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
#!/usr/bin/env bash
22

3+
# expect to have git available
34
root=$(git rev-parse --show-toplevel)
45

6+
# general configuration related to the builder itself
57
ESP8266_ARDUINO_BUILD_DIR=${ESP8266_ARDUINO_BUILD_DIR:-$root}
68
ESP8266_ARDUINO_BUILDER=${ESP8266_ARDUINO_BUILDER:-arduino}
79
ESP8266_ARDUINO_PRESERVE_CACHE=${ESP8266_ARDUINO_PRESERVE_CACHE:-}
810

9-
ESP8266_ARDUINO_CLI=${ESP8266_ARDUINO_CLI:-$HOME/.local/bin/arduino-cli}
10-
ESP8266_ARDUINO_HARDWARE=${ESP8266_ARDUINO_HARDWARE:-$HOME/Arduino/hardware}
11-
ESP8266_ARDUINO_LIBRARIES=${ESP8266_ARDUINO_LIBRARIES:-$HOME/Arduino/libraries}
12-
11+
# sketch build options
1312
ESP8266_ARDUINO_DEBUG=${ESP8266_ARDUINO_DEBUG:-nodebug}
1413
ESP8266_ARDUINO_LWIP=${ESP8266_ARDUINO_LWIP:-default}
1514
ESP8266_ARDUINO_SKETCHES=${ESP8266_ARDUINO_SKETCHES:-}
1615

16+
ESP8266_ARDUINO_CLI=${ESP8266_ARDUINO_CLI:-$HOME/.local/bin/arduino-cli}
17+
18+
# ref. https://arduino.github.io/arduino-cli/1.2/configuration/#default-directories
19+
case "${RUNNER_OS-}" in
20+
"Linux")
21+
ESP8266_ARDUINO_HARDWARE=${ESP8266_ARDUINO_HARDWARE:-$HOME/Arduino/hardware}
22+
ESP8266_ARDUINO_LIBRARIES=${ESP8266_ARDUINO_LIBRARIES:-$HOME/Arduino/libraries}
23+
;;
24+
"macOS")
25+
ESP8266_ARDUINO_HARDWARE=${ESP8266_ARDUINO_HARDWARE:-$HOME/Documents/Arduino/hardware}
26+
ESP8266_ARDUINO_LIBRARIES=${ESP8266_ARDUINO_LIBRARIES:-$HOME/Documents/Arduino/libraries}
27+
;;
28+
"Windows")
29+
ESP8266_ARDUINO_HARDWARE=${ESP8266_ARDUINO_HARDWARE:-$HOME/Documents/Arduino/hardware}
30+
ESP8266_ARDUINO_LIBRARIES=${ESP8266_ARDUINO_LIBRARIES:-$HOME/Documents/Arduino/libraries}
31+
;;
32+
*)
33+
echo 'Unknown ${RUNNER_OS} = "' ${RUNNER_OS} '"'
34+
exit 2
35+
esac
36+
1737
source "$root/tests/common.sh"
1838

1939
cmd=${0##*/}

0 commit comments

Comments
 (0)