Skip to content
This repository was archived by the owner on May 26, 2024. It is now read-only.

Commit 91cd035

Browse files
authored
Merge pull request #2 from 107-systems/fix-#1
Provide GitHub Action based CI.
2 parents bda9aa2 + 2ee35d1 commit 91cd035

11 files changed

+283
-2
lines changed

.github/workflows/arduino-lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Arduino Lint
2+
on:
3+
push:
4+
pull_request:
5+
# Scheduled trigger checks for breakage caused by new rules added to Arduino Lint
6+
schedule:
7+
# run every Saturday at 3 AM UTC
8+
- cron: "0 3 * * 6"
9+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch
10+
workflow_dispatch:
11+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
12+
repository_dispatch:
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
22+
- name: Arduino Lint
23+
uses: arduino/arduino-lint-action@v1
24+
with:
25+
project-type: library
26+
library-manager: submit
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Compile Examples
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/compile-examples.yml"
7+
- "examples/**"
8+
- "src/**"
9+
push:
10+
paths:
11+
- ".github/workflows/compile-examples.yml"
12+
- "examples/**"
13+
- "src/**"
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
SKETCHES_REPORTS_PATH: sketches-reports
21+
LIBRARIES: |
22+
# Install the library from the local path.
23+
- source-path: ./
24+
- name: 107-Arduino-Debug
25+
26+
strategy:
27+
fail-fast: false
28+
29+
matrix:
30+
board:
31+
- fqbn: arduino:samd:mkr1000
32+
platforms: |
33+
- name: arduino:samd
34+
- fqbn: arduino:samd:mkrzero
35+
platforms: |
36+
- name: arduino:samd
37+
- fqbn: arduino:samd:mkrwifi1010
38+
platforms: |
39+
- name: arduino:samd
40+
- fqbn: arduino:samd:mkrfox1200
41+
platforms: |
42+
- name: arduino:samd
43+
- fqbn: arduino:samd:mkrwan1300
44+
platforms: |
45+
- name: arduino:samd
46+
- fqbn: arduino:samd:mkrwan1310
47+
platforms: |
48+
- name: arduino:samd
49+
- fqbn: arduino:samd:mkrgsm1400
50+
platforms: |
51+
- name: arduino:samd
52+
- fqbn: arduino:samd:mkrnb1500
53+
platforms: |
54+
- name: arduino:samd
55+
- fqbn: arduino:samd:mkrvidor4000
56+
platforms: |
57+
- name: arduino:samd
58+
- fqbn: arduino:mbed_portenta:envie_m7
59+
platforms: |
60+
- name: arduino:mbed_portenta
61+
- fqbn: arduino:mbed_portenta:envie_m4
62+
platforms: |
63+
- name: arduino:mbed_portenta
64+
- fqbn: arduino:mbed_nano:nano33ble
65+
platforms: |
66+
- name: arduino:mbed_nano
67+
- fqbn: arduino:mbed_nano:nanorp2040connect
68+
platforms: |
69+
- name: arduino:mbed_nano
70+
- fqbn: arduino:mbed_edge:edge_control
71+
platforms: |
72+
- name: arduino:mbed_edge
73+
- fqbn: esp32:esp32:esp32
74+
platforms: |
75+
- name: esp32:esp32
76+
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
77+
- fqbn: rp2040:rp2040:rpipico
78+
platforms: |
79+
- name: rp2040:rp2040
80+
source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
81+
82+
steps:
83+
- name: Checkout
84+
uses: actions/checkout@v2
85+
86+
- name: Install ESP32 platform dependencies
87+
if: startsWith(matrix.board.fqbn, 'esp32:esp32')
88+
run: pip3 install pyserial
89+
90+
- name: Compile examples
91+
uses: arduino/compile-sketches@main
92+
with:
93+
fqbn: ${{ matrix.board.fqbn }}
94+
platforms: ${{ matrix.board.platforms }}
95+
libraries: ${{ env.LIBRARIES }}
96+
enable-deltas-report: true
97+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
98+
99+
- name: Save memory usage change report as artifact
100+
if: github.event_name == 'pull_request'
101+
uses: actions/upload-artifact@v2
102+
with:
103+
name: ${{ env.SKETCHES_REPORTS_PATH }}
104+
path: ${{ env.SKETCHES_REPORTS_PATH }}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Extra Library Checks
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
extra-library-checks:
9+
runs-on: ubuntu-latest
10+
11+
env:
12+
ARDUINO_CI_SCRIPT_FOLDER: extras/ci-tools/arduino-ci-script
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Install arduino-ci-script
19+
run: |
20+
# install arduino-ci-script
21+
git clone https://github.com/per1234/arduino-ci-script.git "$ARDUINO_CI_SCRIPT_FOLDER"
22+
cd "$ARDUINO_CI_SCRIPT_FOLDER"
23+
# Get new tags from the remote
24+
git fetch --tags
25+
# Checkout the latest tag
26+
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
27+
28+
# See: https://github.com/per1234/arduino-ci-script#check_keywords_txt-searchpath-maximumsearchdepth
29+
- name: Check keywords.txt
30+
run: |
31+
source "${ARDUINO_CI_SCRIPT_FOLDER}/arduino-ci-script.sh"
32+
check_keywords_txt "$GITHUB_WORKSPACE"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: General Formatting Checks
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
general-formatting-checks:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
# https://github.com/per1234/formatting-checks
16+
- name: Check for files starting with a blank line
17+
run: find . -path './.git' -prune -or -path './src/boost' -prune -or -type f -print0 | xargs -0 -L1 bash -c 'head -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at start of $0."; false; fi'
18+
19+
- name: Check for unnecessary use of true tabs
20+
run: find . -path './.git' -prune -or -path './src/boost' -prune -or \( -not -name 'keywords.txt' -and -not -name '.gitmodules' -and -type f \) -exec grep --with-filename --line-number --binary-files=without-match --regexp=$'\t' '{}' \; -exec echo 'Tab found.' \; -exec false '{}' +
21+
22+
- name: Check for trailing whitespace
23+
run: find . -path './.git' -prune -or -path './src/boost' -prune -or -type f -exec grep --with-filename --line-number --binary-files=without-match --regexp='[[:blank:]]$' '{}' \; -exec echo 'Trailing whitespace found.' \; -exec false '{}' +
24+
25+
- name: Check for non-Unix line endings
26+
run: find . -path './.git' -prune -or -path './src/boost' -prune -or -type f -exec grep --files-with-matches --binary-files=without-match --regexp=$'\r$' '{}' \; -exec echo 'Non-Unix EOL detected.' \; -exec false '{}' +
27+
28+
- name: Check for blank lines at end of files
29+
run: find . -path './.git' -prune -or -path './src/boost' -prune -or -type f -print0 | xargs -0 -L1 bash -c 'tail -1 "$0" | grep --binary-files=without-match --regexp="^$"; if [[ "$?" == "0" ]]; then echo "Blank line found at end of $0."; false; fi'
30+
31+
- name: Check for files that don't end in a newline
32+
# https://stackoverflow.com/a/25686825
33+
run: find . -path './.git' -prune -or -path './src/boost' -prune -or -type f -print0 | xargs -0 -L1 bash -c 'if test "$(grep --files-with-matches --binary-files=without-match --max-count=1 --regexp='.*' "$0")" && test "$(tail --bytes=1 "$0")"; then echo "No new line at end of $0."; false; fi'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Manage Repository Labels
2+
3+
on:
4+
push:
5+
paths:
6+
- ".github/workflows/manage-labels.yml"
7+
- ".github/repository-labels-data/*.json"
8+
schedule:
9+
# run every Tuesday at 3 AM UTC
10+
- cron: "0 3 * * 2"
11+
# workflow_dispatch event allows the workflow to be triggered manually
12+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#workflow_dispatch
13+
workflow_dispatch:
14+
15+
jobs:
16+
manage-labels:
17+
runs-on: ubuntu-latest
18+
19+
env:
20+
# All JSON files in this folder will be merged.
21+
SOURCE_DATA_FOLDER_PATH: .github/repository-labels-data
22+
# See: https://github.com/lannonbr/issue-label-manager-action#usage
23+
MERGED_DATA_FILE_PATH: .github/labels.json
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
28+
- name: Download universal labels data file
29+
uses: carlosperate/download-file-action@v1.0.3
30+
with:
31+
file-url: https://raw.githubusercontent.com/107-systems/.github/main/universal-repository-labels.json
32+
location: ${{ env.SOURCE_DATA_FOLDER_PATH }}
33+
34+
- name: Merge labels data files
35+
run: |
36+
# Merge all data files and output to the location used by lannonbr/issue-label-manager-action
37+
jq -s '.=.|add|.' "${{ env.SOURCE_DATA_FOLDER_PATH }}"/*.json > "${{ env.MERGED_DATA_FILE_PATH }}"
38+
39+
- name: Update labels
40+
uses: lannonbr/issue-label-manager-action@2.0.0
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Report Size Deltas
2+
3+
on:
4+
schedule:
5+
- cron: '*/5 * * * *'
6+
7+
jobs:
8+
report:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
# See: https://github.com/arduino/report-size-deltas/README.md
13+
- name: Comment size deltas reports to PRs
14+
uses: arduino/report-size-deltas@main

.github/workflows/spell-check.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Spell Check
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
spellcheck:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v2
14+
15+
# See: https://github.com/codespell-project/actions-codespell/blob/master/README.md
16+
- name: Spell check
17+
uses: codespell-project/actions-codespell@master
18+
with:
19+
check_filenames: true
20+
check_hidden: true
21+
skip: ./.git,./src/boost
22+
ignore_words_file: extras/codespell-ignore-words-list.txt

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<a href="https://107-systems.org/"><img align="right" src="https://raw.githubusercontent.com/107-systems/.github/main/logo/107-systems.png" width="15%"></a>
22
`107-Arduino-BoostUnits`
33
====================
4+
[![Arduino Library Badge](https://www.ardu-badge.com/badge/107-Arduino-BoostUnits.svg?)](https://www.ardu-badge.com/107-Arduino-BoostUnits)
5+
[![Compile Examples](https://github.com/107-systems/107-Arduino-BoostUnits/workflows/Compile%20Examples/badge.svg)](https://github.com/107-systems/107-Arduino-BoostUnits/actions?workflow=Compile+Examples)
6+
[![Arduino Lint](https://github.com/107-systems/107-Arduino-BoostUnits/workflows/Arduino%20Lint/badge.svg)](https://github.com/107-systems/107-Arduino-BoostUnits/actions?workflow=Arduino+Lint)
7+
[![keywords.txt Checks](https://github.com/107-systems/107-Arduino-BoostUnits/workflows/Extra%20Library%20Checks/badge.svg)](https://github.com/107-systems/107-Arduino-BoostUnits/actions?workflow=Extra+Library+Checks)
8+
[![General Formatting Checks](https://github.com/107-systems/107-Arduino-BoostUnits/workflows/General%20Formatting%20Checks/badge.svg)](https://github.com/107-systems/107-Arduino-BoostUnits/actions?workflow=General+Formatting+Checks)
9+
[![Spell Check](https://github.com/107-systems/107-Arduino-BoostUnits/workflows/Spell%20Check/badge.svg)](https://github.com/107-systems/107-Arduino-BoostUnits/actions?workflow=Spell+Check)
10+
411
<p align="center">
512
<a href="https://github.com/107-systems/107-Arduino-DroneCore"><img src="https://github.com/107-systems/.github/raw/main/logo/viper.jpg" width="40%"></a>
613
</p>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wan

keywords.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ meter_per_second_squared LITERAL1
9595
meters_per_second_squared LITERAL1
9696
square_meter LITERAL1
9797
square_meters LITERAL1
98-
joule LITERAL1
98+
joule LITERAL1
9999
joules LITERAL1
100100
kilogram_per_cubic_meter LITERAL1
101101
kilograms_per_cubic_meter LITERAL1

0 commit comments

Comments
 (0)