Skip to content

Commit 0632a24

Browse files
committed
add pio test
1 parent 56e8d0d commit 0632a24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4435
-6
lines changed

PlatformIOTest/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.pio
2+
.cache

PlatformIOTest/compile_commands.json

Lines changed: 212 additions & 0 deletions
Large diffs are not rendered by default.

PlatformIOTest/include/README

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
This directory is intended for project header files.
3+
4+
A header file is a file containing C declarations and macro definitions
5+
to be shared between several project source files. You request the use of a
6+
header file in your project source file (C, C++, etc) located in `src` folder
7+
by including it, with the C preprocessing directive `#include'.
8+
9+
```src/main.c
10+
11+
#include "header.h"
12+
13+
int main (void)
14+
{
15+
...
16+
}
17+
```
18+
19+
Including a header file produces the same results as copying the header file
20+
into each source file that needs it. Such copying would be time-consuming
21+
and error-prone. With a header file, the related declarations appear
22+
in only one place. If they need to be changed, they can be changed in one
23+
place, and programs that include the header file will automatically use the
24+
new version when next recompiled. The header file eliminates the labor of
25+
finding and changing all the copies as well as the risk that a failure to
26+
find one copy will result in inconsistencies within a program.
27+
28+
In C, the convention is to give header files names that end with `.h'.
29+
30+
Read more about using header files in official GCC documentation:
31+
32+
* Include Syntax
33+
* Include Operation
34+
* Once-Only Headers
35+
* Computed Includes
36+
37+
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html

PlatformIOTest/lib/README

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
This directory is intended for project specific (private) libraries.
3+
PlatformIO will compile them to static libraries and link into the executable file.
4+
5+
The source code of each library should be placed in a separate directory
6+
("lib/your_library_name/[Code]").
7+
8+
For example, see the structure of the following example libraries `Foo` and `Bar`:
9+
10+
|--lib
11+
| |
12+
| |--Bar
13+
| | |--docs
14+
| | |--examples
15+
| | |--src
16+
| | |- Bar.c
17+
| | |- Bar.h
18+
| | |- library.json (optional. for custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
19+
| |
20+
| |--Foo
21+
| | |- Foo.c
22+
| | |- Foo.h
23+
| |
24+
| |- README --> THIS FILE
25+
|
26+
|- platformio.ini
27+
|--src
28+
|- main.c
29+
30+
Example contents of `src/main.c` using Foo and Bar:
31+
```
32+
#include <Foo.h>
33+
#include <Bar.h>
34+
35+
int main (void)
36+
{
37+
...
38+
}
39+
40+
```
41+
42+
The PlatformIO Library Dependency Finder will find automatically dependent
43+
libraries by scanning project source files.
44+
45+
More information about PlatformIO Library Dependency Finder
46+
- https://docs.platformio.org/page/librarymanager/ldf.html

PlatformIOTest/lib/Servo/.codespellrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = ,
5+
check-filenames =
6+
check-hidden =
7+
skip = ./.git
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
2+
version: 2
3+
4+
updates:
5+
# Configure check for outdated GitHub Actions actions in workflows.
6+
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
7+
- package-ecosystem: github-actions
8+
directory: / # Check the repository's workflows under /.github/workflows/
9+
schedule:
10+
interval: daily
11+
labels:
12+
- "topic: infrastructure"
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Arduino
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
26+
# Always use this setting for official repositories. Remove for 3rd party projects.
27+
official: true
28+
project-type: library
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
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:avr:nano
35+
platforms: |
36+
- name: arduino:avr
37+
artifact-name-suffix: arduino-avr-nano
38+
- fqbn: arduino:avr:mega
39+
platforms: |
40+
- name: arduino:avr
41+
artifact-name-suffix: arduino-avr-mega
42+
- fqbn: arduino:avr:leonardo
43+
platforms: |
44+
- name: arduino:avr
45+
artifact-name-suffix: arduino-avr-leonardo
46+
- fqbn: arduino:megaavr:nona4809
47+
platforms: |
48+
- name: arduino:megaavr
49+
artifact-name-suffix: arduino-megaavr-nona4809
50+
- fqbn: arduino:sam:arduino_due_x_dbg
51+
platforms: |
52+
- name: arduino:sam
53+
artifact-name-suffix: arduino-sam-arduino_due_x_dbg
54+
- fqbn: arduino:samd:mkrzero
55+
platforms: |
56+
- name: arduino:samd
57+
artifact-name-suffix: arduino-samd-mkrzero
58+
- fqbn: arduino:mbed_portenta:envie_m7:target_core=cm4
59+
platforms: |
60+
- name: arduino:mbed_portenta
61+
artifact-name-suffix: arduino-mbed_portenta-envie_m7-target_core-cm4
62+
- fqbn: arduino:mbed_portenta:envie_m7
63+
platforms: |
64+
- name: arduino:mbed_portenta
65+
artifact-name-suffix: arduino-mbed_portenta-envie_m7
66+
- fqbn: arduino:mbed_nano:nano33ble
67+
platforms: |
68+
- name: arduino:mbed_nano
69+
artifact-name-suffix: arduino-mbed_nano-nano33ble
70+
- fqbn: arduino:mbed_nano:nanorp2040connect
71+
platforms: |
72+
- name: arduino:mbed_nano
73+
artifact-name-suffix: arduino-mbed_nano-nanorp2040connect
74+
75+
steps:
76+
- name: Checkout repository
77+
uses: actions/checkout@v4
78+
79+
- name: Compile examples
80+
uses: arduino/compile-sketches@v1
81+
with:
82+
github-token: ${{ secrets.GITHUB_TOKEN }}
83+
fqbn: ${{ matrix.board.fqbn }}
84+
platforms: ${{ matrix.board.platforms }}
85+
libraries: |
86+
# Install the library from the local path.
87+
- source-path: ./
88+
# Additional library dependencies can be listed here.
89+
# See: https://github.com/arduino/compile-sketches#libraries
90+
sketch-paths: |
91+
- examples
92+
enable-deltas-report: true
93+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
94+
95+
- name: Save sketches report as workflow artifact
96+
uses: actions/upload-artifact@v4
97+
with:
98+
if-no-files-found: error
99+
path: ${{ env.SKETCHES_REPORTS_PATH }}
100+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
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-.+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Spell Check
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 new misspelling detections resulting from dictionary updates.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
spellcheck:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Spell check
22+
uses: codespell-project/actions-codespell@master

0 commit comments

Comments
 (0)