Skip to content

Commit

Permalink
Setting up CI smoke test by building all repository examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
aentinger committed Apr 30, 2024
1 parent 3152a69 commit 2407448
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
on:
- push
- pull_request

env:
# It's convenient to set variables for values used multiple times in the workflow.
SKETCHES_REPORTS_PATH: sketches-reports

jobs:
compile:
runs-on: ubuntu-latest

strategy:
matrix:
board:
- fqbn: arduino:mbed_opta:opta
artifact-name-suffix: arduino-mbed_opta-opta

steps:
- uses: actions/checkout@v4

- uses: arduino/compile-sketches@v1
with:
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
enable-deltas-report: true
github-token: ${{ secrets.GITHUB_TOKEN }}
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

# This step is needed to pass the size data to the report job.
- name: Upload sketches report to workflow artifact
uses: actions/upload-artifact@v4
with:
name: sketches-reports-${{ matrix.board.artifact-name-suffix }}
path: ${{ env.SKETCHES_REPORTS_PATH }}

# When using a matrix to compile for multiple boards, it's necessary to use a separate job for the deltas report
report:
needs: compile # Wait for the compile job to finish to get the data for the report
if: github.event_name == 'pull_request' # Only run the job when the workflow is triggered by a pull request
runs-on: ubuntu-latest

steps:
# This step is needed to get the size data produced by the compile jobs
- name: Download sketches reports artifacts
uses: actions/download-artifact@v4
with:
# All workflow artifacts will be downloaded to this location.
path: ${{ env.SKETCHES_REPORTS_PATH }}

- uses: arduino/report-size-deltas@v1
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
:floppy_disk: `Arduino_open62541`
=================================
[![Compile Examples](https://github.com/bcmi-labs/Arduino_open62541/workflows/Compile%20Examples/badge.svg)](https://github.com/bcmi-labs/Arduino_open62541/actions?workflow=Compile+Examples)
[![Arduino Lint](https://github.com/bcmi-labs/Arduino_open62541/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/bcmi-labs/Arduino_open62541/actions/workflows/arduino-lint.yml)
[![Sync Labels status](https://github.com/bcmi-labs/Arduino_open62541/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/bcmi-labs/Arduino_open62541/actions/workflows/sync-labels.yml)

Expand Down

0 comments on commit 2407448

Please sign in to comment.