1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

ci: fix checking CI_GITHUB_API_KEY, refactoring (#5496)

* ci: fix checking for presence of CI_GITHUB_API_KEY

CI_GITHUB_API_KEY is always set when evaluating job include/exclude conditions, and it only gets removed when the job starts. Move the check into the script.

* ci: split build jobs into separate shell scripts
This commit is contained in:
Ivan Grokhotkov
2018-12-15 09:58:30 +08:00
committed by david gauchard
parent 64f7147da3
commit 79553e539a
8 changed files with 96 additions and 93 deletions

View File

@ -126,37 +126,6 @@ function install_ide()
export PATH="$ide_path:$core_path/tools/xtensa-lx106-elf/bin:$PATH"
}
function build_docs()
{
SPHINXOPTS="-W" make html
}
function run_host_tests()
{
pushd host
make CI
make clean-objects
popd
}
function build_package()
{
export PKG_URL=https://github.com/esp8266/Arduino/releases/download/$TRAVIS_TAG/esp8266-$TRAVIS_TAG.zip
export DOC_URL=https://arduino-esp8266.readthedocs.io/en/$TRAVIS_TAG/
./build_boards_manager_package.sh
}
function build_boards()
{
echo -e "travis_fold:start:build_boards"
tools/boards.txt.py --boardsgen --ldgen --packagegen --docgen
git diff --exit-code -- boards.txt \
doc/boards.rst \
tools/sdk/ld/
git diff --exit-code -w -- package/package_esp8266com_index.template.json
echo -e "travis_fold:end:build_boards"
}
function install_platformio()
{
pip install --user -U https://github.com/platformio/platformio/archive/develop.zip
@ -239,22 +208,6 @@ function build_sketches_with_arduino()
echo -e "travis_fold:end:size_report"
}
function check_examples_style()
{
echo -e "travis_fold:start:check_examples_style"
find $TRAVIS_BUILD_DIR/libraries -name '*.ino' -exec \
astyle \
--suffix=none \
--options=$TRAVIS_BUILD_DIR/tests/examples_style.conf {} \;
# we have no control over submodules
git submodule foreach --recursive git reset --hard
git diff --exit-code -- $TRAVIS_BUILD_DIR/libraries
echo -e "travis_fold:end:check_examples_style"
}
set -e
@ -293,25 +246,8 @@ elif [ "$BUILD_TYPE" = "platformio_odd" ]; then
# PlatformIO
install_platformio
build_sketches_with_platformio $TRAVIS_BUILD_DIR/libraries "--board nodemcuv2 --verbose" 2 1
elif [ "$BUILD_TYPE" = "docs" ]; then
# Build documentation using Sphinx
cd $TRAVIS_BUILD_DIR/doc
build_docs
elif [ "$BUILD_TYPE" = "package" ]; then
# Check that boards.txt, ld scripts, package JSON template, and boards.rst are up to date
build_boards
# Build release package
cd $TRAVIS_BUILD_DIR/package
build_package
elif [ "$BUILD_TYPE" = "host_tests" ]; then
# Run host side tests
cd $TRAVIS_BUILD_DIR/tests
run_host_tests
elif [ "$BUILD_TYPE" = "style_check" ]; then
# Check code style
check_examples_style
else
echo "BUILD_TYPE not set"
echo "BUILD_TYPE not set or invalid"
exit 1
fi