From 70a896481d978f02567c32350768476ad2d6bb9b Mon Sep 17 00:00:00 2001 From: Me No Dev Date: Wed, 21 Aug 2019 01:56:05 +0300 Subject: [PATCH] Update Both CIs to run parallel jobs (#3120) --- .github/workflows/main.yml | 64 ++++------------------------- .travis.yml | 73 ++++++++++++++++++++++++++++----- tools/build-release.sh | 5 +++ tools/build-tests.sh | 83 ++++++++++++++++++++++++++------------ 4 files changed, 131 insertions(+), 94 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c5e60b0f00..146e28042df 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,11 @@ name: ESP32 Arduino CI -on: [pull_request] +on: + push: + branches: + - master + - release/* + pull_request: jobs: @@ -17,8 +22,7 @@ jobs: - name: Install Arduino IDE env: - ESP32_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_EVENT_NAME: ${{ github.event_name }} + #ESP32_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TRAVIS_BUILD_DIR: ${{ github.workspace }} run: ./tools/prep-arduino-ide.sh - name: Test Arduino IDE @@ -36,9 +40,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -58,9 +59,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -80,9 +78,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -102,9 +97,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -124,9 +116,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -146,9 +135,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -168,9 +154,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -190,9 +173,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -212,9 +192,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -234,9 +211,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -256,9 +230,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -278,9 +249,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -300,9 +268,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -322,9 +287,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -344,9 +306,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -366,9 +325,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -388,9 +344,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Arduino IDE env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -411,9 +364,6 @@ jobs: - uses: actions/checkout@v1 - name: Pull submodules run: git submodule update --init --recursive - - name: Run CMake Check - run: ./tools/check_cmakelists.sh - - name: Install Python Wheel run: pip install wheel - name: Install GCC Toolchain diff --git a/.travis.yml b/.travis.yml index 9225828b15e..5c5b0f0a424 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,22 +10,73 @@ os: git: depth: false -env: - global: +# new script start +before_install: + - git submodule update --init --recursive + +stages: + - build + - deploy + +jobs: + include: + + - name: "Build Arduino 0" + if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) + stage: build + script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 0 4 + + - name: "Build Arduino 1" + if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) + stage: build + script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 1 4 + + - name: "Build Arduino 2" + if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) + stage: build + script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 2 4 + + - name: "Build Arduino 3" + if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) + stage: build + script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 3 4 + + - name: "Build PlatformIO" + if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) + stage: build + script: $TRAVIS_BUILD_DIR/tools/build-tests.sh 4 4 + + - name: "Package & Deploy" + if: tag IS present + stage: deploy + script: bash $TRAVIS_BUILD_DIR/tools/build-release.sh + env: - secure: "l/4Dt+KQ/mACtGAHDUsPr66fUte840PZoQ4xpPikqWZI0uARu4l+Ym7+sHinnT6fBqrj8AJeBYGz4nFa8NK4LutZn9mSD40w+sxl0wSV4oHV8rzKe3Cd8+sMG3+o33yWoikMNjSvqa73Q0rm+SgrlInNdZbuAyixL+a2alaWSnGPm4F2xwUGj+S33TOy5P/Xp77CYtCV5S8vzyk/eEdNhoF0GYePJVdfuzCOUjXMyT5OWxORkzzQ7Hnn/Ka/RDfV8Si4HgujLQBrK5q6iPnNBFqBSqilYBepSMn4opnOBpIm0SCgePz7XQEFC83buA7GUcnCnfg38bf+dCwHaODf1d1PmqVRYt2QmfinexXtM4afAtL0iBUDtvrfnXHzwW9w82VeZhpbJSVh9DUQvB0IlsZeCz9J9PUBAi3N+SMX+9l+BomYwRUlPuKY+Ef2JKk9q6mxtUkky5R0daAlVxEhpVdQks1rT+T+NMoDMemxQ3SKEiqAHh6EgHecruszffmZ71uLX9MpERpew0qN+UFiafws+jkTjx+3yF9yut0Hf9sMbeAYzzkGzRqJTUEBJ6B29Cql8M0yRXCNN/8wuuTHhG8esstozga4ZQoIVrq7mEAgup376PTcNfr1+imbbWVQ7lJdYIuDe6OS5V3OX6np11vgK/DbhfyzvQv9Z1zAGnM=" - REMOTE_URL=https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG - -script: - - bash $TRAVIS_BUILD_DIR/tools/build.sh + before_deploy: git submodule update --init + deploy: + - provider: script + skip_cleanup: true + script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease + on: + tags: true -deploy: - provider: script - skip_cleanup: true - script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease +# old script start +# env: +# global: +# - secure: "l/4Dt+KQ/mACtGAHDUsPr66fUte840PZoQ4xpPikqWZI0uARu4l+Ym7+sHinnT6fBqrj8AJeBYGz4nFa8NK4LutZn9mSD40w+sxl0wSV4oHV8rzKe3Cd8+sMG3+o33yWoikMNjSvqa73Q0rm+SgrlInNdZbuAyixL+a2alaWSnGPm4F2xwUGj+S33TOy5P/Xp77CYtCV5S8vzyk/eEdNhoF0GYePJVdfuzCOUjXMyT5OWxORkzzQ7Hnn/Ka/RDfV8Si4HgujLQBrK5q6iPnNBFqBSqilYBepSMn4opnOBpIm0SCgePz7XQEFC83buA7GUcnCnfg38bf+dCwHaODf1d1PmqVRYt2QmfinexXtM4afAtL0iBUDtvrfnXHzwW9w82VeZhpbJSVh9DUQvB0IlsZeCz9J9PUBAi3N+SMX+9l+BomYwRUlPuKY+Ef2JKk9q6mxtUkky5R0daAlVxEhpVdQks1rT+T+NMoDMemxQ3SKEiqAHh6EgHecruszffmZ71uLX9MpERpew0qN+UFiafws+jkTjx+3yF9yut0Hf9sMbeAYzzkGzRqJTUEBJ6B29Cql8M0yRXCNN/8wuuTHhG8esstozga4ZQoIVrq7mEAgup376PTcNfr1+imbbWVQ7lJdYIuDe6OS5V3OX6np11vgK/DbhfyzvQv9Z1zAGnM=" +# - REMOTE_URL=https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG + +# script: +# - bash $TRAVIS_BUILD_DIR/tools/build.sh - on: - tags: true +# deploy: +# provider: script +# skip_cleanup: true +# script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease +# on: +# tags: true notifications: email: diff --git a/tools/build-release.sh b/tools/build-release.sh index 3de516603b2..6d95fba13ae 100755 --- a/tools/build-release.sh +++ b/tools/build-release.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [ -z "$TRAVIS_TAG" ]; then + echo "Skipping Packaging: Regular build" + exit 0 +fi + ############################################################ # $1 - download link # $2 - JSON output file diff --git a/tools/build-tests.sh b/tools/build-tests.sh index b60150681b0..53c186a9523 100755 --- a/tools/build-tests.sh +++ b/tools/build-tests.sh @@ -1,33 +1,64 @@ #!/bin/bash -# CMake Test -echo -e "travis_fold:start:check_cmakelists" -tools/check_cmakelists.sh -if [ $? -ne 0 ]; then exit 1; fi -echo -e "travis_fold:end:check_cmakelists" +if [ ! -z "$TRAVIS_TAG" ]; then + echo "Skipping Test: Tagged build" + exit 0 +fi + +CHUNK_INDEX=$1 +CHUNKS_CNT=$2 +BUILD_PIO=0 +if [ "$#" -lt 2 ]; then + echo "Building all sketches" + CHUNK_INDEX=0 + CHUNKS_CNT=1 + BUILD_PIO=1 +fi +if [ "$CHUNKS_CNT" -le 0 ]; then + CHUNK_INDEX=0 + CHUNKS_CNT=1 + BUILD_PIO=1 +fi +if [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ]; then + CHUNK_INDEX=$CHUNKS_CNT +fi +if [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then + BUILD_PIO=1 +fi -# ArduinoIDE Test -echo -e "travis_fold:start:prep_arduino_ide" -tools/prep-arduino-ide.sh -if [ $? -ne 0 ]; then exit 1; fi -echo -e "travis_fold:end:prep_arduino_ide" +# CMake Test +if [ "$CHUNK_INDEX" -eq 0 ]; then + echo -e "travis_fold:start:check_cmakelists" + tools/check_cmakelists.sh + if [ $? -ne 0 ]; then exit 1; fi + echo -e "travis_fold:end:check_cmakelists" +fi -echo -e "travis_fold:start:test_arduino_ide" -tools/test-arduino-ide.sh -if [ $? -ne 0 ]; then exit 1; fi -echo -e "travis_fold:end:test_arduino_ide" +if [ "$BUILD_PIO" -eq 0 ]; then + # ArduinoIDE Test + echo -e "travis_fold:start:prep_arduino_ide" + tools/prep-arduino-ide.sh + if [ $? -ne 0 ]; then exit 1; fi + echo -e "travis_fold:end:prep_arduino_ide" -echo -e "travis_fold:start:size_report" -cat size.log -echo -e "travis_fold:end:size_report" + echo -e "travis_fold:start:test_arduino_ide" + tools/test-arduino-ide.sh $CHUNK_INDEX $CHUNKS_CNT + if [ $? -ne 0 ]; then exit 1; fi + echo -e "travis_fold:end:test_arduino_ide" -# PlatformIO Test -echo -e "travis_fold:start:prep_platformio" -tools/prep-platformio.sh -if [ $? -ne 0 ]; then exit 1; fi -echo -e "travis_fold:end:prep_platformio" + echo -e "travis_fold:start:size_report" + cat size.log + echo -e "travis_fold:end:size_report" +else + # PlatformIO Test + echo -e "travis_fold:start:prep_platformio" + cd tools && python get.py && cd .. + tools/prep-platformio.sh + if [ $? -ne 0 ]; then exit 1; fi + echo -e "travis_fold:end:prep_platformio" -echo -e "travis_fold:start:test_platformio" -tools/test-platformio.sh -if [ $? -ne 0 ]; then exit 1; fi -echo -e "travis_fold:end:test_platformio" + echo -e "travis_fold:start:test_platformio" + tools/test-platformio.sh + if [ $? -ne 0 ]; then exit 1; fi + echo -e "travis_fold:end:test_platformio" +fi \ No newline at end of file