-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First take at migrating to github actions
Signed-off-by: Sara Damiano <[email protected]>
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 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,90 @@ | ||
name: Build Examples | ||
|
||
# Triggers the workflow on push or pull request events | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'ci skip')" | ||
|
||
strategy: | ||
matrix: | ||
example: | ||
[ | ||
examples/BlynkClient, | ||
examples/FileDownload, | ||
examples/MqttClient, | ||
examples/WebClient, | ||
tools/AT_Debug, | ||
tools/Diagnostics, | ||
tools/FactoryReset, | ||
] | ||
modem: | ||
[ | ||
TINY_GSM_MODEM_A6, | ||
TINY_GSM_MODEM_BG96, | ||
TINY_GSM_MODEM_ESP8266, | ||
TINY_GSM_MODEM_M95, | ||
TINY_GSM_MODEM_M590, | ||
TINY_GSM_MODEM_MC60, | ||
TINY_GSM_MODEM_SIM800, | ||
TINY_GSM_MODEM_SIM808, | ||
TINY_GSM_MODEM_SIM5360, | ||
TINY_GSM_MODEM_SIM7600, | ||
TINY_GSM_MODEM_SIM7000, | ||
TINY_GSM_MODEM_UBLOX, | ||
TINY_GSM_MODEM_SARAR4, | ||
TINY_GSM_MODEM_XBEE, | ||
TINY_GSM_MODEM_SEQUANS_MONARCH, | ||
] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set variables | ||
run: | | ||
if [[ -z "${GITHUB_HEAD_REF}" ]]; then | ||
echo "::debug::Push to commit ${GITHUB_SHA}" | ||
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_SHA}" >> $GITHUB_ENV | ||
else | ||
echo "::debug::Pull Request from the ${GITHUB_HEAD_REF} branch" | ||
echo "LIBRARY_INSTALL_SOURCE=https://github.com/${GITHUB_REPOSITORY}.git#${GITHUB_HEAD_REF}" >> $GITHUB_ENV | ||
fi | ||
- name: Restore or Cache pip | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/pip | ||
# if requirements.txt hasn't changed, then it will be a "cache hit" and pip will be restored | ||
# if requirements.txt HAS changed, it will be a "cache miss" and a new cache of pip will be created if the job completes successfully | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: ${{ runner.os }}-pip- | ||
|
||
- name: Restore or Cache PlatformIO and Libraries | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.platformio | ||
# if nothing in the lock files has changed, then it will be a "cache hit" and pip will be restored | ||
# otherwise, it will be a "cache miss" and a new cache of libraries will be created if the job completes successfully | ||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
# This should be pulled from cache, if there's not a new version | ||
- name: Install PlatformIO | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install --upgrade platformio | ||
- name: Run PlatformIO | ||
env: | ||
PLATFORMIO_CI_SRC: ${{ matrix.example }} | ||
TINYGSM_MODEM_TO_USE: ${{ matrix.modem }} | ||
run: | | ||
echo "${{ env.LIBRARY_INSTALL_SOURCE }}" | ||
pio lib --global install ${{ env.LIBRARY_INSTALL_SOURCE }} | ||
pio lib --global install 89 415 1202 1286 | ||
platformio ci --project-option='build_flags=-D ${{ env.TINYGSM_MODEM_TO_USE }}' --project-option='framework=arduino' --board=uno --board=leonardo --board=yun --board=megaatmega2560 --board=genuino101 --board=mkr1000USB --board=zero --board=teensy31 --board=bluepill_f103c8 --board=uno_pic32 --board=esp01 --board=nodemcuv2 --board=esp32dev | ||
pio lib --global uninstall TinyGSM |
File renamed without changes.