From 07b3c1747994c241f3b5d9bb761cd9bbbc098cdc Mon Sep 17 00:00:00 2001 From: Roberto Sora Date: Wed, 2 Oct 2019 09:29:42 +0200 Subject: [PATCH 1/2] add official github action --- .github/workflows/build-examples.yml | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/build-examples.yml diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml new file mode 100644 index 00000000..bb60fdfa --- /dev/null +++ b/.github/workflows/build-examples.yml @@ -0,0 +1,50 @@ +name: Build Library Examples +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + fqbn: [ + "arduino:samd:mkrwifi1010", + "arduino:samd:nano_33_iot", + "arduino:megaavr:uno2018:mode=on", + "arduino:mbed:nano33ble" + ] + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + + - name: Setup arduino-cli + uses: arduino/actions/setup-arduino-cli@master + + - name: Export FQBN and BOARD + run: | + FQBN=${{ matrix.fqbn }} + CORE=`echo "$FQBN" | cut -d':' -f1,2` + echo ::set-env name=FQBN::"$FQBN" + echo ::set-env name=CORE::"$CORE" + + - name: Install Core + run: | + set -x + arduino-cli core update-index + arduino-cli core install $CORE + + - name: Symlink Library + run: | + set -x + mkdir -p $HOME/Arduino/libraries + ln -s $PWD $HOME/Arduino/libraries/. + + - name: Compile Examples + run: | + set -x + EXAMPLES=`find examples/ -name *.ino | xargs` + for EXAMPLE in $EXAMPLES; do + echo Building example $EXAMPLE + arduino-cli compile --verbose --warnings all --fqbn $FQBN $EXAMPLE + done || exit 1 \ No newline at end of file From 5c6fa02c52d7727cfd09270c0c69195363628c0d Mon Sep 17 00:00:00 2001 From: Roberto Sora Date: Wed, 2 Oct 2019 09:46:00 +0200 Subject: [PATCH 2/2] use folders instead of ino files --- .github/workflows/build-examples.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-examples.yml b/.github/workflows/build-examples.yml index bb60fdfa..9022256c 100644 --- a/.github/workflows/build-examples.yml +++ b/.github/workflows/build-examples.yml @@ -43,7 +43,7 @@ jobs: - name: Compile Examples run: | set -x - EXAMPLES=`find examples/ -name *.ino | xargs` + EXAMPLES=`find examples/ -name '*.ino' | xargs dirname | uniq` for EXAMPLE in $EXAMPLES; do echo Building example $EXAMPLE arduino-cli compile --verbose --warnings all --fqbn $FQBN $EXAMPLE