|
1 |
| -# setup-arduino-cli |
| 1 | +# `arduino/arduino-lint-action` |
2 | 2 |
|
3 |
| -[](https://github.com/arduino/setup-arduino-cli/actions) |
| 3 | +[](https://github.com/arduino/arduino-lint-action/actions?workflow=Test+Action) |
| 4 | +[](https://github.com/arduino/arduino-lint-action/actions?workflow=Integration+Tests) |
| 5 | +[](https://github.com/arduino/arduino-lint-action/actions?workflow=Spell+Check) |
4 | 6 |
|
5 |
| -This action makes the `arduino-cli` tool available to Workflows. |
| 7 | +[GitHub Actions](https://docs.github.com/en/free-pro-team@latest/actions) action that uses |
| 8 | +[Arduino Lint](https://github.com/arduino/arduino-lint) to check for problems with [Arduino](https://www.arduino.cc/) |
| 9 | +projects: |
6 | 10 |
|
7 |
| -## Usage |
| 11 | +- Libraries |
| 12 | +- Sketches |
| 13 | +- Boards platforms |
8 | 14 |
|
9 |
| -To get the latest stable version of `arduino-cli` just add this step: |
| 15 | +## Table of contents |
10 | 16 |
|
11 |
| -```yaml |
12 |
| -- name: Install Arduino CLI |
13 |
| - |
14 |
| -``` |
| 17 | +<!-- toc --> |
15 | 18 |
|
16 |
| -If you want to pin a major or minor version you can use the `.x` wildcard: |
| 19 | +- [Inputs](#inputs) |
| 20 | + - [`path`](#path) |
| 21 | + - [`version`](#version) |
| 22 | + - [`compliance`](#compliance) |
| 23 | + - [`format`](#format) |
| 24 | + - [`library-manager`](#library-manager) |
| 25 | + - [`project-type`](#project-type) |
| 26 | + - [`recursive`](#recursive) |
| 27 | + - [`report-file`](#report-file) |
| 28 | + - [`token`](#token) |
| 29 | +- [Usage](#usage) |
17 | 30 |
|
18 |
| -```yaml |
19 |
| -- name: Install Arduino CLI |
20 |
| - |
21 |
| - with: |
22 |
| - version: "0.x" |
23 |
| -``` |
| 31 | +<!-- tocstop --> |
24 | 32 |
|
25 |
| -To pin the exact version: |
| 33 | +## Inputs |
26 | 34 |
|
27 |
| -```yaml |
28 |
| -- name: Install Arduino CLI |
29 |
| - |
30 |
| - with: |
31 |
| - version: "0.5.0" |
32 |
| -``` |
| 35 | +### `path` |
33 | 36 |
|
34 |
| -## Examples |
| 37 | +Path containing Arduino project(s). |
35 | 38 |
|
36 |
| -[Here][example] there is a good example on how to use the action. |
37 |
| -See also the [Arduino on GitHub Actions blogpost][blogpost] to learn more. |
| 39 | +**Default**: `./` |
38 | 40 |
|
39 |
| -## Development |
| 41 | +### `version` |
40 | 42 |
|
41 |
| -To work on the codebase you have to install all the dependencies: |
| 43 | +The version of [Arduino Lint](https://github.com/arduino/arduino-lint) to use. |
| 44 | +Can be an exact version (e.g., `1.0.0`) or a version range (e.g., `1.x`). |
42 | 45 |
|
43 |
| -```sh |
44 |
| -# npm install |
45 |
| -``` |
| 46 | +**Default**: `1.x` |
46 | 47 |
|
47 |
| -To run tests set the environment variable `GITHUB_TOKEN` with a valid Personal Access Token and then: |
| 48 | +### `compliance` |
48 | 49 |
|
49 |
| -```sh |
50 |
| -# npm run test |
51 |
| -``` |
| 50 | +Configure how strict the tool is about which checks are considered errors vs warnings if they don't pass. |
| 51 | + |
| 52 | +#### Supported values |
| 53 | + |
| 54 | +- `strict` - enforces best practices, above and beyond the minimum requirements for specification compliance. Use this setting to ensure the best experience for the users of the project. |
| 55 | +- `specification` - enforces compliance with the official Arduino project specifications. |
| 56 | +- `permissive` - will cause the checks to fail only when severe problems are found. Although a project that passes at the permissive setting will work with the current Arduino development software versions, it may not be fully specification-compliant, risking incompatibility or a poor experience for the users. |
| 57 | + |
| 58 | +**Default**: `specification` |
| 59 | + |
| 60 | +### `library-manager` |
| 61 | + |
| 62 | +Configure the checks for libraries in the [Arduino Library Manager](https://github.com/arduino/Arduino/wiki/Library-Manager-FAQ) index. |
| 63 | + |
| 64 | +#### Supported values |
| 65 | + |
| 66 | +- `submit` - Also run additional checks required to pass before a library is accepted for inclusion in the index. |
| 67 | +- `update`- Also run additional checks required to pass before a library is accepted for inclusion in the index. |
| 68 | +- `false` - Don't run any Library Manager-specific checks. |
| 69 | + |
| 70 | +**Default**: `submit` for libraries, `false` for other project types |
| 71 | + |
| 72 | +### `project-type` |
| 73 | + |
| 74 | +Configures which types of projects to check, along with their subprojects. |
52 | 75 |
|
53 |
| -See the [official Github documentation][pat-docs] to know more about Personal Access Tokens. |
| 76 | +#### Supported values |
| 77 | + |
| 78 | +- `sketch` |
| 79 | +- `library` |
| 80 | +- `all` - Run checks on any type of project that is detected |
| 81 | + |
| 82 | +**Default**: `all` |
| 83 | + |
| 84 | +### `recursive` |
| 85 | + |
| 86 | +Set to `true` to search path recursively for Arduino projects to check. |
| 87 | + |
| 88 | +**Default**: `false` |
| 89 | + |
| 90 | +### `report-file` |
| 91 | + |
| 92 | +Save a JSON formatted report on the checks to this file. |
| 93 | + |
| 94 | +### `verbose` |
| 95 | + |
| 96 | +Set to `true` to show more information in the log about the checks being run. |
| 97 | + |
| 98 | +**Default**: `false` |
| 99 | + |
| 100 | +### `token` |
| 101 | + |
| 102 | +GitHub access token used to get information from the GitHub API. |
| 103 | + |
| 104 | +**Default**: [`GITHUB_TOKEN`](https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow) |
| 105 | + |
| 106 | +## Usage |
| 107 | + |
| 108 | +The minimal workflow to run the default checks on the projects in the repository: |
| 109 | + |
| 110 | +```yaml |
| 111 | +on: [push, pull_request] |
| 112 | +jobs: |
| 113 | + lint: |
| 114 | + runs-on: ubuntu-latest |
| 115 | + steps: |
| 116 | + - uses: actions/checkout@v2 |
| 117 | + - uses: arduino/arduino-lint-action@v1 |
| 118 | +``` |
54 | 119 |
|
55 |
| -## Release |
| 120 | +## Contributing |
56 | 121 |
|
57 |
| -1. `npm install` to add all the dependencies, included development. |
58 |
| -2. `npm run build` to build the Action under the `./lib` folder. |
59 |
| -3. `npm run test` to see everything works as expected. |
60 |
| -4. `npm run pack` to package for distribution |
61 |
| -5. `git add src dist` to check in the code that matters. |
62 |
| -6. open a PR and request a review. |
| 122 | +To report bugs or make feature requests, please submit an issue: https://github.com/arduino/arduino-lint-action/issues |
63 | 123 |
|
64 |
| -[pat-docs]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token |
65 |
| -[example]: https://github.com/arduino/arduino-cli-example/blob/master/.github/workflows/test.yaml |
66 |
| -[blogpost]: https://blog.arduino.cc/2019/11/14/arduino-on-github-actions/ |
| 124 | +Pull requests are welcome! Please see the [contribution guidelines](.github/CONTRIBUTING.md) for information. |
0 commit comments