Skip to content

Commit

Permalink
Update Both CIs to run parallel jobs (#3120)
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored Aug 20, 2019
1 parent 390da0d commit 70a8964
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 94 deletions.
64 changes: 7 additions & 57 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: ESP32 Arduino CI

on: [pull_request]
on:
push:
branches:
- master
- release/*
pull_request:

jobs:

Expand All @@ -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
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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
Expand Down
73 changes: 62 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions tools/build-release.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
83 changes: 57 additions & 26 deletions tools/build-tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 70a8964

Please sign in to comment.