forked from espressif/arduino-esp32
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request espressif#7 from me-no-dev/master
Build system overhaul
- Loading branch information
Showing
12 changed files
with
364 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Cron Build | ||
|
||
on: | ||
schedule: | ||
# ┌───────────── minute (0 - 59) | ||
# │ ┌───────────── hour (0 - 23) | ||
# │ │ ┌───────────── day of the month (1 - 31) | ||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | ||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# * * * * * | ||
- cron: '0 */6 * * *' | ||
|
||
jobs: | ||
run: | ||
name: Build with IDF ${{ matrix.idf_branch }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
idf_branch: [release/v3.2] | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache | ||
- name: Install Python Wheel | ||
run: pip install wheel | ||
- name: Build | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} | ||
IDF_BRANCH: ${{ matrix.idf_branch }} | ||
run: bash ./tools/cron.sh | ||
- name: Upload archive | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: artifacts | ||
path: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Remote Trigger | ||
|
||
on: repository_dispatch | ||
|
||
jobs: | ||
run: | ||
name: Dispatch Event | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Install dependencies | ||
run: sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache | ||
- name: Install Python Wheel | ||
run: pip install wheel | ||
- name: Handle Event | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }} | ||
run: bash ./tools/repository_dispatch.sh | ||
- name: Upload archive | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: artifacts | ||
path: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
#!/bin/bash | ||
|
||
IDF_COMMIT=$(git -C "$IDF_PATH" rev-parse --short HEAD) | ||
IDF_BRANCH=$(git -C "$IDF_PATH" symbolic-ref --short HEAD) | ||
|
||
idf_version_string=${IDF_BRANCH//\//_}"-$IDF_COMMIT" | ||
archive_path="dist/arduino-esp32-libs-$idf_version_string.tar.gz" | ||
build_archive_path="dist/arduino-esp32-build-$idf_version_string.tar.gz" | ||
|
||
mkdir -p dist && \ | ||
rm -rf $archive_path && \ | ||
cd out && \ | ||
tar zcf ../$archive_path * \ | ||
&& cd .. | ||
mkdir -p dist && rm -rf "$archive_path" "$build_archive_path" | ||
if [ -d "out" ]; then | ||
cd out && tar zcf "../$archive_path" * && cd .. | ||
fi | ||
if [ -d "build" ]; then | ||
cd build && tar zcf "../$build_archive_path" * && cd .. | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
if [ ! "$GITHUB_EVENT_NAME" == "schedule" ]; then | ||
echo "Wrong event '$GITHUB_EVENT_NAME'!" | ||
exit 1 | ||
fi | ||
|
||
git checkout "$IDF_BRANCH" #local branches should match what the matrix wants to build | ||
source ./build.sh | ||
bash ./tools/push-to-arduino.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
source ./tools/config.sh | ||
|
||
if [ -x $GITHUB_TOKEN ]; then | ||
echo "ERROR: GITHUB_TOKEN was not defined" | ||
exit 1 | ||
fi | ||
|
||
if ! [ -d "$AR_COMPS/arduino" ]; then | ||
echo "ERROR: Target arduino folder does not exist!" | ||
exit 1 | ||
fi | ||
|
||
# | ||
# UPDATE FILES | ||
# | ||
|
||
if [ $AR_HAS_COMMIT == "0" ]; then | ||
cd $AR_COMPS/arduino | ||
|
||
# make changes to the files | ||
echo "Patching files in branch '$AR_NEW_BRANCH_NAME'..." | ||
rm -rf $AR_COMPS/arduino/tools/sdk | ||
cp -Rf $AR_SDK $AR_COMPS/arduino/tools/sdk | ||
cp -f $AR_ESPTOOL_PY $AR_COMPS/arduino/tools/esptool.py | ||
cp -f $AR_GEN_PART_PY $AR_COMPS/arduino/tools/gen_esp32part.py | ||
cp -f $AR_PLATFORMIO_PY $AR_COMPS/arduino/tools/platformio-build.py | ||
cp -f $AR_PLATFORM_TXT $AR_COMPS/arduino/platform.txt | ||
|
||
# did any of the files change? | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo "Pushing changes to branch '$AR_NEW_BRANCH_NAME'..." | ||
git add . && git commit --message "$AR_NEW_COMMIT_MESSAGE" && git push -u origin $AR_NEW_BRANCH_NAME | ||
if [ $? -ne 0 ]; then | ||
echo "ERROR: Pushing to branch '$AR_NEW_BRANCH_NAME' failed" | ||
exit 1 | ||
fi | ||
else | ||
echo "No changes in branch '$AR_NEW_BRANCH_NAME'" | ||
if [ $AR_HAS_BRANCH == "0" ]; then | ||
echo "Delete created branch '$AR_NEW_BRANCH_NAME'" | ||
git branch -d $AR_NEW_BRANCH_NAME | ||
fi | ||
exit 0 | ||
fi | ||
fi | ||
|
||
# | ||
# CREATE PULL REQUEST | ||
# | ||
|
||
if [ "$AR_HAS_PR" == "0" ]; then | ||
pr_created=`git_create_pr "$AR_NEW_BRANCH_NAME" "$AR_NEW_PR_TITLE"` | ||
if [ $pr_created == "0" ]; then | ||
echo "ERROR: Failed to create PR '$AR_NEW_PR_TITLE': "`echo "$git_create_pr_res" | jq -r '.message'`": "`echo "$git_create_pr_res" | jq -r '.errors[].message'` | ||
exit 1 | ||
fi | ||
fi | ||
exit 0 |
Oops, something went wrong.