Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DODO�
arduino-esp32
提交
d0b064a1
A
arduino-esp32
项目概览
DODO�
/
arduino-esp32
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
arduino-esp32
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
d0b064a1
编写于
10月 02, 2019
作者:
M
Me No Dev
提交者:
GitHub
10月 02, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update CI scripts for better error handling (#3316)
上级
85c77a9c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
63 addition
and
68 deletion
+63
-68
.github/scripts/install-arduino-core-esp32.sh
.github/scripts/install-arduino-core-esp32.sh
+15
-21
.github/scripts/install-arduino-ide.sh
.github/scripts/install-arduino-ide.sh
+12
-11
.github/scripts/install-platformio-esp32.sh
.github/scripts/install-platformio-esp32.sh
+34
-34
.github/scripts/on-push.sh
.github/scripts/on-push.sh
+2
-2
未找到文件。
.github/scripts/install-arduino-core-esp32.sh
浏览文件 @
d0b064a1
...
...
@@ -2,39 +2,33 @@
export
ARDUINO_ESP32_PATH
=
"
$ARDUINO_USR_PATH
/hardware/espressif/esp32"
if
[
!
-d
"
$ARDUINO_ESP32_PATH
"
]
;
then
echo
"Installing ESP32 Arduino Core
in '
$ARDUINO_ESP32_PATH
'
..."
echo
"Installing ESP32 Arduino Core ..."
script_init_path
=
"
$PWD
"
mkdir
-p
"
$ARDUINO_USR_PATH
/hardware/espressif"
&&
\
mkdir
-p
"
$ARDUINO_USR_PATH
/hardware/espressif"
cd
"
$ARDUINO_USR_PATH
/hardware/espressif"
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
echo
"Installing Python Serial ..."
pip
install
pyserial
>
/dev/null
if
[
"
$OS_IS_WINDOWS
"
==
"1"
]
;
then
echo
"Installing Python Requests ..."
pip
install
requests
>
/dev/null
fi
if
[
"
$GITHUB_REPOSITORY
"
==
"espressif/arduino-esp32"
]
;
then
echo
"Linking Core..."
&&
\
echo
"Linking Core..."
ln
-s
$GITHUB_WORKSPACE
esp32
else
echo
"Cloning Core Repository..."
&&
\
echo
"Cloning Core Repository..."
git clone https://github.com/espressif/arduino-esp32.git esp32
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: GIT clone failed"
;
exit
1
;
fi
fi
cd
esp32
&&
\
echo
"Updating Submodules..."
&&
\
echo
"Updating Submodules ..."
cd
esp32
git submodule update
--init
--recursive
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Submodule update failed"
;
exit
1
;
fi
echo
"Installing Python Serial..."
&&
\
pip
install
pyserial
>
/dev/null
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Install failed"
;
exit
1
;
fi
if
[
"
$OS_IS_WINDOWS
"
==
"1"
]
;
then
echo
"Installing Python Requests..."
pip
install
requests
>
/dev/null
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Install failed"
;
exit
1
;
fi
fi
echo
"Installing Platform Tools..."
echo
"Installing Platform Tools
..."
cd
tools
&&
python get.py
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Download failed"
;
exit
1
;
fi
cd
$script_init_path
echo
"ESP32 Arduino has been installed in '
$ARDUINO_ESP32_PATH
'"
...
...
.github/scripts/install-arduino-ide.sh
浏览文件 @
d0b064a1
...
...
@@ -46,28 +46,23 @@ else
fi
if
[
!
-d
"
$ARDUINO_IDE_PATH
"
]
;
then
echo
"Installing Arduino IDE on
$OS_NAME
..."
echo
"Downloading 'arduino-nightly-
$OS_NAME
.
$ARCHIVE_FORMAT
' to 'arduino.
$ARCHIVE_FORMAT
'..."
echo
"Installing Arduino IDE on
$OS_NAME
..."
echo
"Downloading 'arduino-nightly-
$OS_NAME
.
$ARCHIVE_FORMAT
' to 'arduino.
$ARCHIVE_FORMAT
'
..."
if
[
"
$OS_IS_LINUX
"
==
"1"
]
;
then
wget
-O
"arduino.
$ARCHIVE_FORMAT
"
"https://www.arduino.cc/download.php?f=/arduino-nightly-
$OS_NAME
.
$ARCHIVE_FORMAT
"
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Download failed"
;
exit
1
;
fi
echo
"Extracting 'arduino.
$ARCHIVE_FORMAT
'..."
echo
"Extracting 'arduino.
$ARCHIVE_FORMAT
' ..."
tar
xf
"arduino.
$ARCHIVE_FORMAT
"
>
/dev/null
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
mv
arduino-nightly
"
$ARDUINO_IDE_PATH
"
else
curl
-o
"arduino.
$ARCHIVE_FORMAT
"
-L
"https://www.arduino.cc/download.php?f=/arduino-nightly-
$OS_NAME
.
$ARCHIVE_FORMAT
"
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Download failed"
;
exit
1
;
fi
echo
"Extracting 'arduino.
$ARCHIVE_FORMAT
'..."
echo
"Extracting 'arduino.
$ARCHIVE_FORMAT
' ..."
unzip
"arduino.
$ARCHIVE_FORMAT
"
>
/dev/null
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
if
[
"
$OS_IS_MACOS
"
==
"1"
]
;
then
mv
"Arduino.app"
"/Applications/Arduino.app"
else
mv
arduino-nightly
"
$ARDUINO_IDE_PATH
"
fi
fi
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
rm
-rf
"arduino.
$ARCHIVE_FORMAT
"
mkdir
-p
"
$ARDUINO_USR_PATH
/libraries"
...
...
@@ -95,7 +90,7 @@ function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
fi
echo
""
echo
"Compiling '"
$(
basename
"
$sketch
"
)
"'..."
echo
"Compiling '"
$(
basename
"
$sketch
"
)
"'
..."
mkdir
-p
"
$ARDUINO_BUILD_DIR
"
mkdir
-p
"
$ARDUINO_CACHE_DIR
"
$ARDUINO_IDE_PATH
/arduino-builder
-compile
-logger
=
human
-core-api-version
=
10810
\
...
...
@@ -115,9 +110,13 @@ function build_sketch(){ # build_sketch <fqbn> <path-to-ino> [extra-options]
function
count_sketches
()
# count_sketches <examples-path>
{
local
examples
=
"
$1
"
rm
-rf
sketches.txt
if
[
!
-d
"
$examples
"
]
;
then
touch
sketches.txt
return
0
fi
local
sketches
=
$(
find
$examples
-name
*
.ino
)
local
sketchnum
=
0
rm
-rf
sketches.txt
for
sketch
in
$sketches
;
do
local
sketchdir
=
$(
dirname
$sketch
)
local
sketchdirname
=
$(
basename
$sketchdir
)
...
...
@@ -163,8 +162,10 @@ function build_sketches() # build_sketches <fqbn> <examples-path> <chunk> <total
return
1
fi
set
+e
count_sketches
"
$examples
"
local
sketchcount
=
$?
set
-e
local
sketches
=
$(
cat
sketches.txt
)
rm
-rf
sketches.txt
...
...
.github/scripts/install-platformio-esp32.sh
100644 → 100755
浏览文件 @
d0b064a1
...
...
@@ -2,40 +2,34 @@
export
PLATFORMIO_ESP32_PATH
=
"
$HOME
/.platformio/packages/framework-arduinoespressif32"
echo
"Installing Python Wheel..."
echo
"Installing Python Wheel
..."
pip
install
wheel
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Install failed"
;
exit
1
;
fi
echo
"Installing PlatformIO..."
echo
"Installing PlatformIO
..."
pip
install
-U
https://github.com/platformio/platformio/archive/develop.zip
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Install failed"
;
exit
1
;
fi
echo
"Installing Platform ESP32..."
echo
"Installing Platform ESP32
..."
python
-m
platformio platform
install
https://github.com/platformio/platform-espressif32.git#feature/stage
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Install failed"
;
exit
1
;
fi
echo
"Replacing the framework version..."
echo
"Replacing the framework version
..."
if
[[
"
$OSTYPE
"
==
"darwin"
*
]]
;
then
sed
's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/'
"
$HOME
/.platformio/platforms/espressif32/platform.json"
>
"platform.json"
&&
\
sed
's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/'
"
$HOME
/.platformio/platforms/espressif32/platform.json"
>
"platform.json"
mv
-f
"platform.json"
"
$HOME
/.platformio/platforms/espressif32/platform.json"
else
sed
-i
's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/'
"
$HOME
/.platformio/platforms/espressif32/platform.json"
fi
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Replace failed"
;
exit
1
;
fi
if
[
"
$GITHUB_REPOSITORY
"
==
"espressif/arduino-esp32"
]
;
then
echo
"Linking Core..."
&&
\
echo
"Linking Core..."
ln
-s
$GITHUB_WORKSPACE
"
$PLATFORMIO_ESP32_PATH
"
else
echo
"Cloning Core Repository
..."
&&
\
echo
"Cloning Core Repository
..."
git clone https://github.com/espressif/arduino-esp32.git
"
$PLATFORMIO_ESP32_PATH
"
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: GIT clone failed"
;
exit
1
;
fi
fi
echo
"PlatformIO for ESP32 has been installed"
echo
""
function
build_pio_sketch
(){
# build_pio_sketch <board> <path-to-ino>
if
[
"$#"
-lt
2
]
;
then
echo
"ERROR: Illegal number of parameters"
...
...
@@ -43,20 +37,24 @@ function build_pio_sketch(){ # build_pio_sketch <board> <path-to-ino>
return
1
fi
local
board
=
"
$1
"
local
sketch
=
"
$2
"
local
sketch_dir
=
$(
dirname
"
$sketch
"
)
echo
""
echo
"Compiling '"
$(
basename
"
$sketch
"
)
"'
..."
python
-m
platformio ci
--board
"
$board
"
"
$sketch_dir
"
--project-option
=
"board_build.partitions = huge_app.csv"
local
board
=
"
$1
"
local
sketch
=
"
$2
"
local
sketch_dir
=
$(
dirname
"
$sketch
"
)
echo
""
echo
"Compiling '"
$(
basename
"
$sketch
"
)
"'
..."
python
-m
platformio ci
--board
"
$board
"
"
$sketch_dir
"
--project-option
=
"board_build.partitions = huge_app.csv"
}
function
count_sketches
()
# count_sketches <examples-path>
{
local
examples
=
"
$1
"
local
examples
=
"
$1
"
rm
-rf
sketches.txt
if
[
!
-d
"
$examples
"
]
;
then
touch
sketches.txt
return
0
fi
local
sketches
=
$(
find
$examples
-name
*
.ino
)
local
sketchnum
=
0
rm
-rf
sketches.txt
for
sketch
in
$sketches
;
do
local
sketchdir
=
$(
dirname
$sketch
)
local
sketchdirname
=
$(
basename
$sketchdir
)
...
...
@@ -91,35 +89,37 @@ function build_pio_sketches() # build_pio_sketches <board> <examples-path> <chun
chunks_num
=
"1"
fi
if
[
"
$chunks_num
"
-le
0
]
;
then
echo
"ERROR: Chunks count must be positive number"
return
1
fi
if
[
"
$chunk_idex
"
-ge
"
$chunks_num
"
]
;
then
echo
"ERROR: Chunk index must be less than chunks count"
return
1
fi
if
[
"
$chunks_num
"
-le
0
]
;
then
echo
"ERROR: Chunks count must be positive number"
return
1
fi
if
[
"
$chunk_idex
"
-ge
"
$chunks_num
"
]
;
then
echo
"ERROR: Chunk index must be less than chunks count"
return
1
fi
set
+e
count_sketches
"
$examples
"
local
sketchcount
=
$?
set
-e
local
sketches
=
$(
cat
sketches.txt
)
rm
-rf
sketches.txt
local
chunk_size
=
$((
$sketchcount
/
$chunks_num
))
local
all_chunks
=
$((
$chunks_num
*
$chunk_size
))
if
[
"
$all_chunks
"
-lt
"
$sketchcount
"
]
;
then
chunk_size
=
$((
$chunk_size
+
1
))
chunk_size
=
$((
$chunk_size
+
1
))
fi
local
start_index
=
$((
$chunk_idex
*
$chunk_size
))
if
[
"
$sketchcount
"
-le
"
$start_index
"
]
;
then
echo
"Skipping job"
return
0
echo
"Skipping job"
return
0
fi
local
end_index
=
$((
$((
$chunk_idex
+
1
))
*
$chunk_size
))
if
[
"
$end_index
"
-gt
"
$sketchcount
"
]
;
then
end_index
=
$sketchcount
end_index
=
$sketchcount
fi
local
start_num
=
$((
$start_index
+
1
))
...
...
@@ -141,7 +141,7 @@ function build_pio_sketches() # build_pio_sketches <board> <examples-path> <chun
sketchnum
=
$((
$sketchnum
+
1
))
if
[
"
$sketchnum
"
-le
"
$start_index
"
]
\
||
[
"
$sketchnum
"
-gt
"
$end_index
"
]
;
then
continue
continue
fi
build_pio_sketch
"
$board
"
"
$sketch
"
local
result
=
$?
...
...
.github/scripts/on-push.sh
浏览文件 @
d0b064a1
#!/bin/bash
set
-e
if
[
!
-z
"
$TRAVIS_TAG
"
]
;
then
echo
"Skipping Test: Tagged build"
exit
0
...
...
@@ -52,7 +54,6 @@ if [ "$BUILD_PIO" -eq 0 ]; then
# CMake Test
if
[
"
$CHUNK_INDEX
"
-eq
0
]
;
then
bash
"
$ARDUINO_ESP32_PATH
/.github/scripts/check-cmakelists.sh"
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
build_sketches
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries"
"
$CHUNK_INDEX
"
"
$CHUNKS_CNT
"
fi
...
...
@@ -68,4 +69,3 @@ else
build_pio_sketch
"
$BOARD
"
"
$PLATFORMIO_ESP32_PATH
/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
#build_pio_sketches esp32dev "$PLATFORMIO_ESP32_PATH/libraries"
fi
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录