Skip to content

Commit 77c4f5e

Browse files
Add OSX build to CI, fix OSX builds (#6492)
Build a single sketch using a Travis-CI OSX instance to validate the toolchain works properly on Macs. Update the installed python3 symlink to point to the proper spot for OSX (Python3 is in /usr/local/bin, not /usr/bin). Fixes #6490
1 parent 5ca0bde commit 77c4f5e

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ jobs:
107107
script: $TRAVIS_BUILD_DIR/tests/buildm.sh
108108
env: CC=gcc-7 CXX=g++-7
109109

110+
- name: "MacOS can build sketches"
111+
os: osx
112+
stage: build
113+
script: $TRAVIS_BUILD_DIR/tests/build.sh
114+
env: MACOSX=1 BUILD_PARITY=custom mod=500 rem=1
115+
110116
- name: "Boards"
111117
stage: build
112118
script: $TRAVIS_BUILD_DIR/tests/ci/build_boards.sh

package/package_esp8266com_index.template.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,10 @@
177177
},
178178
{
179179
"host": "x86_64-apple-darwin",
180-
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-placeholder.tar.gz",
181-
"archiveFileName": "python3-placeholder.tar.gz",
182-
"checksum": "SHA-256:d8cf9d9d66423d7b90978ebe285a73a6e8611995cd0d5e6273e929a0cf2c9850",
183-
"size": "191"
180+
"url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/python3-macosx-placeholder.tar.gz",
181+
"archiveFileName": "python3-macosx-placeholder.tar.gz",
182+
"checksum": "SHA-256:5bfa0d4c2dc3edeeaa913f4eac42ef3ff0bf8c8fe9f11be112a8ca7911de2dae",
183+
"size": "198"
184184
},
185185
{
186186
"host": "x86_64-pc-linux-gnu",

tests/common.sh

+16-4
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ function install_libraries()
135135
pushd $HOME/Arduino/libraries
136136

137137
# install ArduinoJson library
138-
{ test -r ArduinoJson-v6.11.0.zip || wget https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip ArduinoJson-v6.11.0.zip
138+
{ test -r ArduinoJson-v6.11.0.zip || wget https://github.com/bblanchon/ArduinoJson/releases/download/v6.11.0/ArduinoJson-v6.11.0.zip; } && unzip -q ArduinoJson-v6.11.0.zip
139139

140140
popd
141141
}
@@ -145,8 +145,21 @@ function install_ide()
145145
local ide_path=$1
146146
local core_path=$2
147147
local debug=$3
148-
test -r arduino.tar.xz || wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
149-
tar xf arduino.tar.xz
148+
if [ "$MACOSX" = "1" ]; then
149+
# MACOS only has next-to-obsolete Python2 installed. Install Python 3 from python.org
150+
wget https://www.python.org/ftp/python/3.7.4/python-3.7.4-macosx10.9.pkg
151+
sudo installer -pkg python-3.7.4-macosx10.9.pkg -target /
152+
# Install the Python3 certificates, because SSL connections fail w/o them and of course they aren't installed by default.
153+
( cd "/Applications/Python 3.7/" && sudo "./Install Certificates.command" )
154+
# Hack to place arduino-builder in the same spot as sane OSes
155+
test -r arduino.zip || wget -O arduino.zip https://downloads.arduino.cc/arduino-nightly-macosx.zip
156+
unzip -q arduino.zip
157+
mv Arduino.app arduino-nightly
158+
mv arduino-nightly/Contents/Java/* arduino-nightly/.
159+
else
160+
test -r arduino.tar.xz || wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
161+
tar xf arduino.tar.xz
162+
fi
150163
mv arduino-nightly $ide_path
151164
cd $ide_path/hardware
152165
mkdir esp8266com
@@ -174,7 +187,6 @@ function install_arduino()
174187
echo -e "travis_fold:start:sketch_test_env_prepare"
175188
cd $TRAVIS_BUILD_DIR
176189
install_ide $HOME/arduino_ide $TRAVIS_BUILD_DIR $debug
177-
which arduino
178190
cd $TRAVIS_BUILD_DIR
179191
install_libraries
180192
echo -e "travis_fold:end:sketch_test_env_prepare"

0 commit comments

Comments
 (0)