Skip to content

Commit a0092e9

Browse files
committed
Add CI workflow for compiling all sketches within the examples folder.
1 parent e375091 commit a0092e9

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Compile Examples
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/compile-examples.yml"
8+
- "examples/**"
9+
- "src/**"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/compile-examples.yml"
13+
- "examples/**"
14+
- "src/**"
15+
schedule:
16+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
17+
- cron: "0 8 * * TUE"
18+
workflow_dispatch:
19+
repository_dispatch:
20+
21+
jobs:
22+
build:
23+
name: ${{ matrix.board.fqbn }}
24+
runs-on: ubuntu-latest
25+
26+
env:
27+
SKETCHES_REPORTS_PATH: sketches-reports
28+
29+
strategy:
30+
fail-fast: false
31+
32+
matrix:
33+
board:
34+
- fqbn: arduino:mbed_giga:giga
35+
platforms: |
36+
- name: arduino:mbed_giga
37+
source-url: https://downloads.arduino.cc/packages/package_mbed_index.json
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
- name: Compile examples
44+
uses: arduino/compile-sketches@v1
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
fqbn: ${{ matrix.board.fqbn }}
48+
platforms: ${{ matrix.board.platforms }}
49+
libraries: |
50+
# Install the library from the local path.
51+
- source-path: ./
52+
sketch-paths: |
53+
- examples
54+
enable-deltas-report: true
55+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
56+
57+
- name: Save sketches report as workflow artifact
58+
uses: actions/upload-artifact@v3
59+
with:
60+
if-no-files-found: error
61+
path: ${{ env.SKETCHES_REPORTS_PATH }}
62+
name: ${{ env.SKETCHES_REPORTS_PATH }}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Report Size Deltas
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/report-size-deltas.yml"
8+
schedule:
9+
# Run at the minimum interval allowed by GitHub Actions.
10+
# Note: GitHub Actions periodically has outages which result in workflow failures.
11+
# In this event, the workflows will start passing again once the service recovers.
12+
- cron: "*/5 * * * *"
13+
workflow_dispatch:
14+
repository_dispatch:
15+
16+
jobs:
17+
report:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Comment size deltas reports to PRs
21+
uses: arduino/report-size-deltas@v1
22+
with:
23+
# The name of the workflow artifact created by the sketch compilation workflow
24+
sketches-reports-source: sketches-reports

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
AdvancedAnalogRedux 〰
22
======================
3+
[![Compile Examples status](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/compile-examples.yml)
34
[![Spell Check status](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/spell-check-task.yml)
45
[![Sync Labels status](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/sync-labels.yml/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions/workflows/sync-labels.yml)
56
[![Arduino Lint](https://github.com/bcmi-labs/AdvancedAnalogRedux/workflows/Arduino%20Lint/badge.svg)](https://github.com/bcmi-labs/AdvancedAnalogRedux/actions?workflow=Arduino+Lint)

0 commit comments

Comments
 (0)