Skip to content

Commit 25fea24

Browse files
authored
Merge pull request #33 from sebromero/workflows
maintenance: Add Github Workflows
2 parents f572a1a + cc76ed5 commit 25fea24

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

.github/workflows/arduino-lint.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Arduino Lint
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Arduino Lint
22+
uses: arduino/arduino-lint-action@v2
23+
with:
24+
compliance: specification
25+
library-manager: update # Change to 'update' once the library is published.
26+
official: true # Always use this setting for official repositories.
27+
project-type: library
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Source: https://github.com/per1234/.github/blob/main/workflow-templates/compile-examples-private.md
2+
name: Compile Examples
3+
4+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5+
on:
6+
push:
7+
paths:
8+
- ".github/workflows/compile-examples.ya?ml"
9+
- "library.properties"
10+
- "examples/**"
11+
- "src/**"
12+
pull_request:
13+
paths:
14+
- ".github/workflows/compile-examples.ya?ml"
15+
- "library.properties"
16+
- "examples/**"
17+
- "src/**"
18+
schedule:
19+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
20+
- cron: "0 8 * * TUE"
21+
workflow_dispatch:
22+
repository_dispatch:
23+
24+
env:
25+
UNIVERSAL_SKETCH_PATHS: |
26+
- examples
27+
SKETCHES_REPORTS_PATH: sketches-reports
28+
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
29+
30+
jobs:
31+
build:
32+
name: ${{ matrix.board.fqbn }}
33+
runs-on: ubuntu-latest
34+
permissions:
35+
contents: read
36+
pull-requests: read
37+
38+
strategy:
39+
fail-fast: false
40+
41+
matrix:
42+
board:
43+
- fqbn: arduino:zephyr:unoq
44+
platforms: |
45+
- name: arduino:zephyr
46+
artifact-name-suffix: arduino-uno_q
47+
48+
steps:
49+
- name: Checkout repository
50+
uses: actions/checkout@v5
51+
52+
- name: Compile examples
53+
uses: arduino/compile-sketches@v1
54+
with:
55+
github-token: ${{ secrets.GITHUB_TOKEN }}
56+
fqbn: ${{ matrix.board.fqbn }}
57+
platforms: ${{ matrix.board.platforms }}
58+
libraries: |
59+
# Install the library from the local path.
60+
- source-path: ./
61+
- name: Arduino_RPClite
62+
# Additional library dependencies can be listed here.
63+
# See: https://github.com/arduino/compile-sketches#libraries
64+
sketch-paths: |
65+
${{ env.UNIVERSAL_SKETCH_PATHS }}
66+
${{ matrix.board.additional-sketch-paths }}
67+
enable-deltas-report: true
68+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
69+
70+
- name: Save sketches report as workflow artifact
71+
uses: actions/upload-artifact@v5
72+
with:
73+
if-no-files-found: error
74+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
75+
path: ${{ env.SKETCHES_REPORTS_PATH }}
Lines changed: 24 additions & 0 deletions
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+
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
24+
sketches-reports-source: ^sketches-report-.+

0 commit comments

Comments
 (0)