Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DODO�
arduino-esp32
提交
caa391ab
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,发现更多精彩内容 >>
未验证
提交
caa391ab
编写于
9月 30, 2019
作者:
M
Me No Dev
提交者:
GitHub
9月 30, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More efficient CI builds (#3303)
* More efficient CI builds * Update main.yml
上级
3b71e136
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
103 addition
and
66 deletion
+103
-66
.github/workflows/main.yml
.github/workflows/main.yml
+12
-21
tools/ci/install-arduino-core-esp32.sh
tools/ci/install-arduino-core-esp32.sh
+4
-3
tools/ci/install-arduino-ide.sh
tools/ci/install-arduino-ide.sh
+28
-14
tools/ci/install-platformio-esp32.sh
tools/ci/install-platformio-esp32.sh
+25
-6
tools/ci/on-push.sh
tools/ci/on-push.sh
+34
-22
未找到文件。
.github/workflows/main.yml
浏览文件 @
caa391ab
...
...
@@ -8,43 +8,34 @@ on:
pull_request
:
jobs
:
# Ubuntu
build-arduino-linux
:
name
:
Arduino ${{ matrix.chunk }} on ubuntu-latest
runs-on
:
ubuntu-latest
strategy
:
matrix
:
chunk
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
]
chunk
:
[
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
]
steps
:
-
uses
:
actions/checkout@v1
-
name
:
Build Sketches
run
:
bash ./tools/ci/on-push.sh ${{ matrix.chunk }}
1
2
run
:
bash ./tools/ci/on-push.sh ${{ matrix.chunk }}
1
5
build-arduino-mac
:
name
:
Arduino ${{ matrix.chunk }} on macOS-latest
runs-on
:
macOS-latest
strategy
:
matrix
:
chunk
:
[
3
,
6
]
steps
:
-
uses
:
actions/checkout@v1
-
name
:
Build Sketches
run
:
bash ./tools/ci/on-push.sh ${{ matrix.chunk }}
12
build-arduino-win
:
name
:
Arduino ${{ matrix.chunk }} on windows-latest
runs-on
:
windows-latest
# Windows and MacOS
build-arduino-win-mac
:
name
:
Arduino on ${{ matrix.os }}
runs-on
:
${{ matrix.os }}
strategy
:
matrix
:
chunk
:
[
5
,
15
,
25
]
os
:
[
windows-latest
,
macOS-latest
]
steps
:
-
uses
:
actions/checkout@v1
-
name
:
Build Sketches
run
:
bash ./tools/ci/on-push.sh
${{ matrix.chunk }}
30
run
:
bash ./tools/ci/on-push.sh
# PlatformIO on Windows, Ubuntu and Mac
build-platformio
:
name
:
PlatformIO on ${{ matrix.os }}
runs-on
:
${{ matrix.os }}
...
...
@@ -55,4 +46,4 @@ jobs:
steps
:
-
uses
:
actions/checkout@v1
-
name
:
Build Sketches
run
:
bash ./tools/ci/on-push.sh 1
1
run
:
bash ./tools/ci/on-push.sh 1
1
#equal and non-zero to trigger PIO
tools/ci/install-arduino-core-esp32.sh
浏览文件 @
caa391ab
#!/bin/bash
if
[
!
-d
"
$ARDUINO_USR_PATH
/hardware/espressif/esp32"
]
;
then
echo
"Installing ESP32 Arduino Core in '
$ARDUINO_USR_PATH
/hardware/espressif/esp32'..."
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
'..."
script_init_path
=
"
$PWD
"
mkdir
-p
"
$ARDUINO_USR_PATH
/hardware/espressif"
&&
\
cd
"
$ARDUINO_USR_PATH
/hardware/espressif"
...
...
@@ -36,6 +37,6 @@ if [ ! -d "$ARDUINO_USR_PATH/hardware/espressif/esp32" ]; then
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Download failed"
;
exit
1
;
fi
cd
$script_init_path
echo
"ESP32 Arduino has been installed in '
$ARDUINO_
USR_PATH
/hardware/espressif/esp32
'"
echo
"ESP32 Arduino has been installed in '
$ARDUINO_
ESP32_PATH
'"
echo
""
fi
tools/ci/install-arduino-ide.sh
浏览文件 @
caa391ab
...
...
@@ -45,9 +45,8 @@ else
export
ARDUINO_USR_PATH
=
"
$HOME
/Arduino"
fi
echo
"Installing Arduino IDE on
$OS_NAME
..."
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
'..."
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
...
...
@@ -70,12 +69,21 @@ if [ ! -d "$ARDUINO_IDE_PATH" ]; then
fi
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
rm
-rf
"arduino.
$ARCHIVE_FORMAT
"
fi
mkdir
-p
"
$ARDUINO_USR_PATH
/libraries"
mkdir
-p
"
$ARDUINO_USR_PATH
/hardware"
mkdir
-p
"
$ARDUINO_USR_PATH
/libraries"
mkdir
-p
"
$ARDUINO_USR_PATH
/hardware"
echo
"Arduino IDE Installed in '
$ARDUINO_IDE_PATH
'"
echo
""
fi
function
build_sketch
(){
# build_sketch <fqbn> <path-to-ino> [extra-options]
if
[
"$#"
-lt
2
]
;
then
echo
"ERROR: Illegal number of parameters"
echo
"USAGE: build_sketch <fqbn> <path-to-ino> [extra-options]"
return
1
fi
local
fqbn
=
"
$1
"
local
sketch
=
"
$2
"
local
xtra_opts
=
"
$3
"
...
...
@@ -126,14 +134,26 @@ function count_sketches() # count_sketches <examples-path>
return
$sketchnum
}
function
build_sketches
()
# build_sketches <
examples-path> <fqbn
> <chunk> <total-chunks> [extra-options]
function
build_sketches
()
# build_sketches <
fqbn> <examples-path
> <chunk> <total-chunks> [extra-options]
{
local
examples
=
$1
local
fqbn
=
$2
local
fqbn
=
$1
local
examples
=
$2
local
chunk_idex
=
$3
local
chunks_num
=
$4
local
xtra_opts
=
$5
if
[
"$#"
-lt
2
]
;
then
echo
"ERROR: Illegal number of parameters"
echo
"USAGE: build_sketches <fqbn> <examples-path> [<chunk> <total-chunks>] [extra-options]"
return
1
fi
if
[
"$#"
-lt
4
]
;
then
chunk_idex
=
"0"
chunks_num
=
"1"
xtra_opts
=
$3
fi
if
[
"
$chunks_num
"
-le
0
]
;
then
echo
"ERROR: Chunks count must be positive number"
return
1
...
...
@@ -195,9 +215,3 @@ function build_sketches() # build_sketches <examples-path> <fqbn> <chunk> <total
return
0
}
echo
"Arduino IDE Installed in '
$ARDUINO_IDE_PATH
'"
# echo "You can install boards in '$ARDUINO_IDE_PATH/hardware' or in '$ARDUINO_USR_PATH/hardware'"
# echo "User libraries should be installed in '$ARDUINO_USR_PATH/libraries'"
# echo "Then you can call 'build_sketch <fqbn> <path-to-ino> [extra-options]' to build your sketches"
echo
""
tools/ci/install-platformio-esp32.sh
浏览文件 @
caa391ab
#!/bin/bash
export
PLATFORMIO_ESP32_PATH
=
"
$HOME
/.platformio/packages/framework-arduinoespressif32"
echo
"Installing Python Wheel..."
pip
install
wheel
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
echo
"ERROR: Install failed"
;
exit
1
;
fi
...
...
@@ -23,10 +25,10 @@ if [ $? -ne 0 ]; then echo "ERROR: Replace failed"; exit 1; fi
if
[
"
$GITHUB_REPOSITORY
"
==
"espressif/arduino-esp32"
]
;
then
echo
"Linking Core..."
&&
\
ln
-s
$GITHUB_WORKSPACE
"
$
HOME
/.platformio/packages/framework-arduinoespressif32
"
ln
-s
$GITHUB_WORKSPACE
"
$
PLATFORMIO_ESP32_PATH
"
else
echo
"Cloning Core Repository..."
&&
\
git clone https://github.com/espressif/arduino-esp32.git
"
$
HOME
/.platformio/packages/framework-arduinoespressif32
"
>
/dev/null 2>&1
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
...
...
@@ -34,7 +36,13 @@ echo "PlatformIO for ESP32 has been installed"
echo
""
function
build_pio_sketch
(){
# build_pio_sketch <board> <path-to-ino> [extra-options]
function
build_pio_sketch
(){
# build_pio_sketch <board> <path-to-ino>
if
[
"$#"
-lt
2
]
;
then
echo
"ERROR: Illegal number of parameters"
echo
"USAGE: build_pio_sketch <board> <path-to-ino>"
return
1
fi
local
board
=
"
$1
"
local
sketch
=
"
$2
"
local
sketch_dir
=
$(
dirname
"
$sketch
"
)
...
...
@@ -65,13 +73,24 @@ function count_sketches() # count_sketches <examples-path>
return
$sketchnum
}
function
build_pio_sketches
()
# build_pio_sketches <
examples-path> <board
> <chunk> <total-chunks>
function
build_pio_sketches
()
# build_pio_sketches <
board> <examples-path
> <chunk> <total-chunks>
{
local
examples
=
$1
local
board
=
$2
if
[
"$#"
-lt
2
]
;
then
echo
"ERROR: Illegal number of parameters"
echo
"USAGE: build_pio_sketches <board> <examples-path> [<chunk> <total-chunks>]"
return
1
fi
local
board
=
$1
local
examples
=
$2
local
chunk_idex
=
$3
local
chunks_num
=
$4
if
[
"$#"
-lt
4
]
;
then
chunk_idex
=
"0"
chunks_num
=
"1"
fi
if
[
"
$chunks_num
"
-le
0
]
;
then
echo
"ERROR: Chunks count must be positive number"
return
1
...
...
tools/ci/on-push.sh
浏览文件 @
caa391ab
...
...
@@ -19,38 +19,50 @@ fi
CHUNK_INDEX
=
$1
CHUNKS_CNT
=
$2
BUILD_PIO
=
0
if
[
"$#"
-lt
2
]
||
[
"
$CHUNKS_CNT
"
-le
0
]
;
then
echo
"Building all sketches"
if
[
"$#"
-lt
2
]
||
[
"
$CHUNKS_CNT
"
-le
0
]
;
then
CHUNK_INDEX
=
0
CHUNKS_CNT
=
1
fi
if
[
"
$CHUNK_INDEX
"
-gt
"
$CHUNKS_CNT
"
]
;
then
elif
[
"
$CHUNK_INDEX
"
-gt
"
$CHUNKS_CNT
"
]
;
then
CHUNK_INDEX
=
$CHUNKS_CNT
fi
if
[
"
$CHUNK_INDEX
"
-eq
"
$CHUNKS_CNT
"
]
;
then
elif
[
"
$CHUNK_INDEX
"
-eq
"
$CHUNKS_CNT
"
]
;
then
BUILD_PIO
=
1
fi
# CMake Test
if
[
"
$CHUNK_INDEX
"
-eq
0
]
;
then
bash ./tools/ci/check-cmakelists.sh
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
if
[
"
$BUILD_PIO
"
-eq
0
]
;
then
# ArduinoIDE Test
FQBN
=
"espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
source
./tools/ci/install-arduino-ide.sh
source
./tools/ci/install-arduino-core-esp32.sh
build_sketches
"
$GITHUB_WORKSPACE
/libraries"
"espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app"
"
$CHUNK_INDEX
"
"
$CHUNKS_CNT
"
if
[
"
$OS_IS_WINDOWS
"
==
"1"
]
;
then
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/BLE/examples/BLE_server/BLE_server.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/AzureIoT/examples/GetStarted/GetStarted.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
elif
[
"
$OS_IS_MACOS
"
==
"1"
]
;
then
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/WiFi/examples/WiFiClient/WiFiClient.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/BLE/examples/BLE_server/BLE_server.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/AzureIoT/examples/GetStarted/GetStarted.ino"
&&
\
build_sketch
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
else
# CMake Test
if
[
"
$CHUNK_INDEX
"
-eq
0
]
;
then
bash
"
$ARDUINO_ESP32_PATH
/tools/ci/check-cmakelists.sh"
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
build_sketches
"
$FQBN
"
"
$ARDUINO_ESP32_PATH
/libraries"
"
$CHUNK_INDEX
"
"
$CHUNKS_CNT
"
fi
else
# PlatformIO Test
source
./tools/ci/install-platformio-esp32.sh
python
-m
platformio ci
--board
esp32dev libraries/WiFi/examples/WiFiClient
&&
\
python
-m
platformio ci
--board
esp32dev libraries/WiFiClientSecure/examples/WiFiClientSecure
&&
\
python
-m
platformio ci
--board
esp32dev libraries/BluetoothSerial/examples/SerialToSerialBT
&&
\
python
-m
platformio ci
--board
esp32dev libraries/BLE/examples/BLE_server
&&
\
python
-m
platformio ci
--board
esp32dev libraries/AzureIoT/examples/GetStarted
&&
\
python
-m
platformio ci
--board
esp32dev libraries/ESP32/examples/Camera/CameraWebServer
--project-option
=
"board_build.partitions = huge_app.csv"
#build_pio_sketches libraries esp32dev $CHUNK_INDEX $CHUNKS_CNT
if
[
$?
-ne
0
]
;
then
exit
1
;
fi
fi
\ No newline at end of file
BOARD
=
"esp32dev"
build_pio_sketch
"
$BOARD
"
"
$PLATFORMIO_ESP32_PATH
/libraries/WiFi/examples/WiFiClient/WiFiClient.ino"
&&
\
build_pio_sketch
"
$BOARD
"
"
$PLATFORMIO_ESP32_PATH
/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino"
&&
\
build_pio_sketch
"
$BOARD
"
"
$PLATFORMIO_ESP32_PATH
/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino"
&&
\
build_pio_sketch
"
$BOARD
"
"
$PLATFORMIO_ESP32_PATH
/libraries/BLE/examples/BLE_server/BLE_server.ino"
&&
\
build_pio_sketch
"
$BOARD
"
"
$PLATFORMIO_ESP32_PATH
/libraries/AzureIoT/examples/GetStarted/GetStarted.ino"
&&
\
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录