├── .github ├── workflows │ ├── testdata │ │ ├── sketches │ │ │ ├── Error │ │ │ │ └── Error.ino │ │ │ ├── BareMinimum │ │ │ │ └── BareMinimum.ino │ │ │ ├── ServoLibrary │ │ │ │ └── ServoLibrary.ino │ │ │ └── TestCompileFlags │ │ │ │ └── TestCompileFlags.ino │ │ ├── platforms │ │ │ ├── PythonPackageDependent │ │ │ │ ├── dependent.py │ │ │ │ ├── platform.txt │ │ │ │ └── boards.txt │ │ │ └── PyserialDependent │ │ │ │ ├── platform.txt │ │ │ │ └── boards.txt │ │ └── reports │ │ │ └── all-inputs │ │ │ ├── arduino-avr-uno.json │ │ │ └── esp8266-esp8266-huzzah.json │ ├── check-workflows-task.yml │ ├── spell-check-task.yml │ ├── check-files-task.yml │ ├── check-action-metadata-task.yml │ ├── check-toc-task.yml │ ├── check-general-formatting-task.yml │ ├── check-poetry-task.yml │ ├── check-taskfiles.yml │ ├── check-python-task.yml │ ├── check-markdown-task.yml │ ├── check-npm-task.yml │ ├── check-yaml-task.yml │ ├── test-python-poetry-task.yml │ ├── check-license.yml │ ├── sync-labels-npm.yml │ ├── check-prettier-formatting-task.yml │ └── test-integration.yml ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature-request.yml │ └── bug-report.yml └── dependabot.yml ├── compilesketches └── tests │ └── testdata │ ├── HasSketches │ ├── NotSketch │ │ └── Foo.bar │ ├── Sketch1 │ │ ├── Sketch1.ino │ │ └── Sketch1b.ino │ ├── Sketch2 │ │ └── Sketch2.pde │ └── NoSketches │ │ └── NotSketch │ │ └── NotSketch.foo │ ├── NoSketches │ └── NotSketch │ │ └── NotSketch.foo │ ├── test_get_archive_root_folder_name │ ├── has-file │ │ ├── not-root.foo │ │ └── not-root │ │ │ └── .gitkeep │ ├── has-root │ │ ├── root │ │ │ └── .gitkeep │ │ └── __MACOSX │ │ │ └── .gitkeep │ └── has-folders │ │ ├── not-root │ │ └── .gitkeep │ │ └── also-not-root │ │ └── .gitkeep │ ├── githubevent.json │ └── test_get_warning_count_from_output │ └── has-warnings.txt ├── .prettierignore ├── codecov.yml ├── .markdownlintignore ├── .npmrc ├── .gitignore ├── .markdown-link-check.json ├── package.json ├── pytest.ini ├── .ecrc ├── .flake8 ├── .codespellrc ├── pyproject.toml ├── .editorconfig ├── .markdownlint.yml ├── .yamllint.yml ├── action.yml ├── docs └── FAQ.md ├── README.md ├── Taskfile.yml └── LICENSE.txt /.github/workflows/testdata/sketches/Error/Error.ino: -------------------------------------------------------------------------------- 1 | #error 2 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/NotSketch/Foo.bar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/Sketch1/Sketch1.ino: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/Sketch1/Sketch1b.ino: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/Sketch2/Sketch2.pde: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/NoSketches/NotSketch/NotSketch.foo: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .licenses/ 2 | .pytest_cache/ 3 | __pycache__/ 4 | node_modules/ 5 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/NoSketches/NotSketch/NotSketch.foo: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-file/not-root.foo: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-root/root/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-file/not-root/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-root/__MACOSX/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-folders/not-root/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/workflows/testdata/sketches/BareMinimum/BareMinimum.ino: -------------------------------------------------------------------------------- 1 | void setup() {} 2 | void loop() {} 3 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-folders/also-not-root/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/workflows/testdata/sketches/ServoLibrary/ServoLibrary.ino: -------------------------------------------------------------------------------- 1 | #include 2 | void setup() {} 3 | void loop() {} 4 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: "100...100" 3 | status: 4 | project: 5 | default: 6 | threshold: 0% 7 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/githubevent.json: -------------------------------------------------------------------------------- 1 | { 2 | "pull_request": { 3 | "head": { 4 | "sha": "pull_request-head-sha" 5 | }, 6 | "number": 42 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.markdownlintignore: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown/.markdownlintignore 2 | .licenses/ 3 | __pycache__/ 4 | node_modules/ 5 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm/.npmrc 2 | # See: https://docs.npmjs.com/cli/configuring-npm/npmrc 3 | 4 | engine-strict=true 5 | -------------------------------------------------------------------------------- /.github/workflows/testdata/platforms/PythonPackageDependent/dependent.py: -------------------------------------------------------------------------------- 1 | # Import external package to verify Python package dependencies can be installed by user into runner environment. 2 | import cowsay # noqa: F401 3 | -------------------------------------------------------------------------------- /.github/workflows/testdata/platforms/PythonPackageDependent/platform.txt: -------------------------------------------------------------------------------- 1 | name=External Python Package Dependent Platform 2 | version=0.0.0 3 | recipe.hooks.prebuild.1.pattern=python "{runtime.platform.path}/dependent.py" 4 | -------------------------------------------------------------------------------- /.github/workflows/testdata/sketches/TestCompileFlags/TestCompileFlags.ino: -------------------------------------------------------------------------------- 1 | #if INT_MACRO != 2 2 | #error 3 | #endif 4 | 5 | #ifndef FLAG_MACRO 6 | #error 7 | #endif 8 | 9 | void setup() { 10 | char string[]=STRING_MACRO; // Will fail if the macro is not a string literal 11 | } 12 | void loop(){} 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Python 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # Testing 7 | htmlcov/ 8 | .coverage 9 | coverage.xml 10 | 11 | # Environments 12 | .venv/ 13 | venv/ 14 | 15 | # IDEs 16 | .idea/ 17 | .vscode/ 18 | *.bak 19 | *.code-workspace 20 | *.sublime-workspace 21 | 22 | /node_modules/ 23 | -------------------------------------------------------------------------------- /.markdown-link-check.json: -------------------------------------------------------------------------------- 1 | { 2 | "httpHeaders": [ 3 | { 4 | "urls": ["https://docs.github.com/"], 5 | "headers": { 6 | "Accept-Encoding": "gzip, deflate, br" 7 | } 8 | } 9 | ], 10 | "retryOn429": true, 11 | "retryCount": 3, 12 | "aliveStatusCodes": [200, 206] 13 | } 14 | -------------------------------------------------------------------------------- /.github/workflows/testdata/platforms/PyserialDependent/platform.txt: -------------------------------------------------------------------------------- 1 | name=pyserial Dependent Platform 2 | version=0.0.0 3 | # python3 is used to parallel ESP32 platform configuration: 4 | # https://github.com/espressif/arduino-esp32/blob/2.0.7/platform.txt#L220 5 | recipe.hooks.prebuild.1.pattern=python3 -c 'import serial' 6 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "devDependencies": { 3 | "ajv-cli": "5.0.0", 4 | "ajv-formats": "3.0.1", 5 | "github-label-sync": "3.0.0", 6 | "markdown-link-check": "3.14.2", 7 | "markdown-toc": "1.2.0", 8 | "markdownlint-cli": "0.47.0", 9 | "prettier": "3.7.4" 10 | }, 11 | "engines": { 12 | "node": "22.x" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/testdata/platforms/PyserialDependent/boards.txt: -------------------------------------------------------------------------------- 1 | pyserial_dependent.name=pyserial Dependent Board 2 | pyserial_dependent.upload.maximum_size=32256 3 | pyserial_dependent.upload.maximum_data_size=2048 4 | pyserial_dependent.build.mcu=atmega328p 5 | pyserial_dependent.build.f_cpu=16000000L 6 | pyserial_dependent.build.board=FOO 7 | pyserial_dependent.build.core=arduino:arduino 8 | pyserial_dependent.build.variant=arduino:standard 9 | -------------------------------------------------------------------------------- /pytest.ini: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-python/pytest.ini 2 | [pytest] 3 | filterwarnings = 4 | error 5 | ignore::DeprecationWarning 6 | ignore::ResourceWarning 7 | 8 | # --capture=no - disable per-test capture 9 | # --tb=long sets the length of the traceback in case of failures 10 | addopts = --capture=no --tb=long --verbose 11 | pythonpath = compilesketches 12 | -------------------------------------------------------------------------------- /.github/workflows/testdata/platforms/PythonPackageDependent/boards.txt: -------------------------------------------------------------------------------- 1 | package_dependent.name=External Python Package Dependent Board 2 | package_dependent.upload.maximum_size=32256 3 | package_dependent.upload.maximum_data_size=2048 4 | package_dependent.build.mcu=atmega328p 5 | package_dependent.build.f_cpu=16000000L 6 | package_dependent.build.board=FOO 7 | package_dependent.build.core=arduino:arduino 8 | package_dependent.build.variant=arduino:standard 9 | -------------------------------------------------------------------------------- /.ecrc: -------------------------------------------------------------------------------- 1 | { 2 | "Exclude": [ 3 | "^\\.git[/\\\\]", 4 | "^\\.licenses[/\\\\]", 5 | ".pytest_cache[/\\\\]", 6 | "__pycache__[/\\\\]", 7 | "node_modules[/\\\\]", 8 | "^LICENSE\\.txt$", 9 | "^poetry\\.lock$", 10 | "\\.py$", 11 | "^compilesketches[/\\\\]tests[/\\\\]testdata[/\\\\]test_get_warning_count_from_output[/\\\\]has-warnings\\.txt$", 12 | "^compilesketches[/\\\\]tests[/\\\\]testdata[/\\\\]test_get_warning_count_from_output[/\\\\]no-warnings\\.txt$" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python/.flake8 2 | # See: https://flake8.pycqa.org/en/latest/user/configuration.html 3 | # The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and 4 | # should not be modified. 5 | 6 | [flake8] 7 | doctests = True 8 | # W503 and W504 are mutually exclusive. PEP 8 recommends line break before. 9 | ignore = E501,W503 10 | max-complexity = 10 11 | max-line-length = 120 12 | select = E,W,F,C,N 13 | -------------------------------------------------------------------------------- /.codespellrc: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc 2 | # See: https://github.com/codespell-project/codespell#using-a-config-file 3 | [codespell] 4 | # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: 5 | ignore-words-list = afterall,clude 6 | skip = ./.git,./.licenses,.pytest_cache,__pycache__,node_modules,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock 7 | builtin = clear,informal,en-GB_to_en-US 8 | check-filenames = 9 | check-hidden = 10 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/template-choosers/github-actions/config.yml 2 | # See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser 3 | 4 | blank_issues_enabled: false 5 | contact_links: 6 | - name: Learn about using this project 7 | url: https://github.com/arduino/compile-sketches#readme 8 | about: Detailed usage documentation is available here. 9 | - name: Learn about GitHub Actions 10 | url: https://docs.github.com/actions 11 | about: Everything you need to know to get started with GitHub Actions. 12 | - name: Support request 13 | url: https://forum.arduino.cc/ 14 | about: We can help you out on the Arduino Forum! 15 | - name: Discuss development work on the project 16 | url: https://groups.google.com/a/arduino.cc/g/developers 17 | about: Arduino Developers Mailing List 18 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # See: https://docs.github.com/en/code-security/supply-chain-security/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 and action metadata. 6 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/dependabot/README.md 7 | # See: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-actions-up-to-date-with-dependabot 8 | - package-ecosystem: github-actions 9 | assignees: 10 | - per1234 11 | directory: / 12 | open-pull-requests-limit: 100 13 | schedule: 14 | interval: daily 15 | labels: 16 | - "topic: infrastructure" 17 | - package-ecosystem: npm 18 | assignees: 19 | - per1234 20 | directory: / 21 | open-pull-requests-limit: 100 22 | schedule: 23 | interval: daily 24 | labels: 25 | - "topic: infrastructure" 26 | - package-ecosystem: pip 27 | assignees: 28 | - per1234 29 | directory: / 30 | open-pull-requests-limit: 100 31 | schedule: 32 | interval: daily 33 | labels: 34 | - "topic: infrastructure" 35 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.black] 2 | line-length = 120 3 | 4 | [tool.poetry] 5 | package-mode = false 6 | 7 | [tool.poetry.dependencies] 8 | python = "3.12.4" 9 | GitPython = "3.1.45" 10 | PyGithub = "2.8.1" 11 | PyYAML = "6.0.3" 12 | semver = "3.0.4" 13 | 14 | [tool.poetry.group.dev.dependencies] 15 | black = "25.12.0" 16 | codespell = "2.4.1" 17 | coverage = "7.13.0" 18 | pytest = "9.0.2" 19 | pytest-mock = "3.15.1" 20 | flake8 = "7.3.0" 21 | pep8-naming = "0.15.1" 22 | yamllint = "1.37.1" 23 | 24 | [tool.poetry.group.external] 25 | # Provided only for use by boards platforms 26 | # NOTE: This group is a temporary workaround that will be removed at the 2.0.0 release of the action. 27 | optional = true 28 | 29 | [tool.poetry.group.external.dependencies] 30 | pyserial = "3.5" 31 | 32 | # The dependencies in this group are installed using pipx; NOT Poetry. The use of a `poetry` section is a hack required 33 | # in order to be able to manage updates of these dependencies via Dependabot, as used for all other dependencies. 34 | [tool.poetry.group.pipx] 35 | optional = true 36 | 37 | [tool.poetry.group.pipx.dependencies] 38 | poetry = "2.2.1" 39 | 40 | [build-system] 41 | requires = ["poetry-core"] 42 | build-backend = "poetry.core.masonry.api" 43 | -------------------------------------------------------------------------------- /.github/workflows/check-workflows-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-workflows-task.md 2 | name: Check Workflows 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | push: 7 | paths: 8 | - ".github/workflows/*.ya?ml" 9 | - ".npmrc" 10 | - "package.json" 11 | - "package-lock.json" 12 | - "Taskfile.ya?ml" 13 | pull_request: 14 | paths: 15 | - ".github/workflows/*.ya?ml" 16 | - ".npmrc" 17 | - "package.json" 18 | - "package-lock.json" 19 | - "Taskfile.ya?ml" 20 | schedule: 21 | # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. 22 | - cron: "0 8 * * TUE" 23 | workflow_dispatch: 24 | repository_dispatch: 25 | 26 | jobs: 27 | validate: 28 | runs-on: ubuntu-latest 29 | permissions: 30 | contents: read 31 | 32 | steps: 33 | - name: Checkout repository 34 | uses: actions/checkout@v6 35 | 36 | - name: Setup Node.js 37 | uses: actions/setup-node@v6 38 | with: 39 | node-version-file: package.json 40 | 41 | - name: Install Task 42 | uses: arduino/setup-task@v2 43 | with: 44 | repo-token: ${{ secrets.GITHUB_TOKEN }} 45 | version: 3.x 46 | 47 | - name: Validate workflows 48 | run: task --silent ci:validate 49 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/general/.editorconfig 2 | # See: https://editorconfig.org/ 3 | # The formatting style defined in this file is the official standardized style to be used in all Arduino Tooling 4 | # projects and should not be modified. 5 | # Note: indent style for each file type is defined even when it matches the universal config in order to make it clear 6 | # that this type has an official style. 7 | 8 | [*] 9 | charset = utf-8 10 | end_of_line = lf 11 | indent_size = 2 12 | indent_style = space 13 | insert_final_newline = true 14 | trim_trailing_whitespace = true 15 | 16 | [*.{adoc,asc,asciidoc}] 17 | indent_size = 2 18 | indent_style = space 19 | 20 | [*.{bash,sh}] 21 | indent_size = 2 22 | indent_style = space 23 | 24 | [*.{c,cc,cp,cpp,cxx,h,hh,hpp,hxx,ii,inl,ino,ixx,pde,tpl,tpp,txx}] 25 | indent_size = 2 26 | indent_style = space 27 | 28 | [*.{go,mod}] 29 | indent_style = tab 30 | 31 | [*.java] 32 | indent_size = 2 33 | indent_style = space 34 | 35 | [*.{js,jsx,json,jsonc,json5,ts,tsx}] 36 | indent_size = 2 37 | indent_style = space 38 | 39 | [*.{md,mdx,mkdn,mdown,markdown}] 40 | indent_size = unset 41 | indent_style = space 42 | 43 | [*.proto] 44 | indent_size = 2 45 | indent_style = space 46 | 47 | [*.py] 48 | indent_size = 4 49 | indent_style = space 50 | 51 | [*.svg] 52 | indent_size = 2 53 | indent_style = space 54 | 55 | [*.{yaml,yml}] 56 | indent_size = 2 57 | indent_style = space 58 | 59 | [{.gitconfig,.gitmodules}] 60 | indent_style = tab 61 | -------------------------------------------------------------------------------- /.markdownlint.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown/.markdownlint.yml 2 | # See: https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md 3 | # The code style defined in this file is the official standardized style to be used in all Arduino projects and should 4 | # not be modified. 5 | # Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment. 6 | 7 | default: false 8 | MD001: false 9 | MD002: false 10 | MD003: false # Prettier 11 | MD004: false # Prettier 12 | MD005: false # Prettier 13 | MD006: false # Prettier 14 | MD007: false # Prettier 15 | MD008: false # Prettier 16 | MD009: 17 | br_spaces: 0 18 | strict: true 19 | list_item_empty_lines: false # Prettier 20 | MD010: false # Prettier 21 | MD011: true 22 | MD012: false # Prettier 23 | MD013: false 24 | MD014: false 25 | MD018: true 26 | MD019: false # Prettier 27 | MD020: true 28 | MD021: false # Prettier 29 | MD022: false # Prettier 30 | MD023: false # Prettier 31 | MD024: false 32 | MD025: 33 | level: 1 34 | front_matter_title: '^\s*"?title"?\s*[:=]' 35 | MD026: false 36 | MD027: false # Prettier 37 | MD028: false 38 | MD029: 39 | style: one 40 | MD030: 41 | ul_single: 1 42 | ol_single: 1 43 | ul_multi: 1 44 | ol_multi: 1 45 | MD031: false # Prettier 46 | MD032: false # Prettier 47 | MD033: false 48 | MD034: false 49 | MD035: false # Prettier 50 | MD036: false 51 | MD037: true 52 | MD038: true 53 | MD039: true 54 | MD040: false 55 | MD041: false 56 | MD042: true 57 | MD043: false 58 | MD044: false 59 | MD045: true 60 | MD046: 61 | style: fenced 62 | MD047: false # Prettier 63 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/general/bug-report.yml 2 | # See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 3 | 4 | name: Feature request 5 | description: Suggest an enhancement to this project. 6 | labels: 7 | - "type: enhancement" 8 | body: 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: Describe the request 13 | validations: 14 | required: true 15 | - type: textarea 16 | id: current 17 | attributes: 18 | label: Describe the current behavior 19 | description: | 20 | What is the current behavior of `arduino/compile-sketches` in relation to your request? 21 | How can we reproduce that behavior? 22 | validations: 23 | required: true 24 | - type: input 25 | id: project-version 26 | attributes: 27 | label: "'arduino/compile-sketches' version" 28 | description: | 29 | Which version of `arduino/compile-sketches` are you using? 30 | _This should be the most recent version available._ 31 | validations: 32 | required: true 33 | - type: textarea 34 | id: additional 35 | attributes: 36 | label: Additional context 37 | description: Add any additional information here. 38 | validations: 39 | required: false 40 | - type: checkboxes 41 | id: checklist 42 | attributes: 43 | label: Issue checklist 44 | description: Please double-check that you have done each of the following things before submitting the issue. 45 | options: 46 | - label: I searched for previous requests in [the issue tracker](https://github.com/arduino/compile-sketches/issues?q=) 47 | required: true 48 | - label: I verified the feature was still missing when using the latest version 49 | required: true 50 | - label: My request contains all necessary details 51 | required: true 52 | -------------------------------------------------------------------------------- /.github/workflows/spell-check-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/spell-check-task.md 2 | name: Spell Check 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | pull_request: 9 | schedule: 10 | # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. 11 | - cron: "0 8 * * TUE" 12 | workflow_dispatch: 13 | repository_dispatch: 14 | 15 | jobs: 16 | run-determination: 17 | runs-on: ubuntu-latest 18 | permissions: {} 19 | outputs: 20 | result: ${{ steps.determination.outputs.result }} 21 | steps: 22 | - name: Determine if the rest of the workflow should run 23 | id: determination 24 | run: | 25 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 26 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 27 | if [[ 28 | "${{ github.event_name }}" != "create" || 29 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 30 | ]]; then 31 | # Run the other jobs. 32 | RESULT="true" 33 | else 34 | # There is no need to run the other jobs. 35 | RESULT="false" 36 | fi 37 | 38 | echo "result=$RESULT" >> $GITHUB_OUTPUT 39 | 40 | spellcheck: 41 | needs: run-determination 42 | if: needs.run-determination.outputs.result == 'true' 43 | runs-on: ubuntu-latest 44 | permissions: 45 | contents: read 46 | 47 | steps: 48 | - name: Checkout repository 49 | uses: actions/checkout@v6 50 | 51 | - name: Install Python 52 | uses: actions/setup-python@v6 53 | with: 54 | python-version-file: pyproject.toml 55 | 56 | - name: Install Task 57 | uses: arduino/setup-task@v2 58 | with: 59 | repo-token: ${{ secrets.GITHUB_TOKEN }} 60 | version: 3.x 61 | 62 | - name: Spell check 63 | run: task general:check-spelling 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/issue-templates/forms/general/bug-report.yml 2 | # See: https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms 3 | 4 | name: Bug report 5 | description: Report a problem with the code or documentation in this repository. 6 | labels: 7 | - "type: imperfection" 8 | body: 9 | - type: textarea 10 | id: description 11 | attributes: 12 | label: Describe the problem 13 | validations: 14 | required: true 15 | - type: textarea 16 | id: reproduce 17 | attributes: 18 | label: To reproduce 19 | description: Provide the specific set of steps we can follow to reproduce the problem. 20 | validations: 21 | required: true 22 | - type: textarea 23 | id: expected 24 | attributes: 25 | label: Expected behavior 26 | description: What would you expect to happen after following those instructions? 27 | validations: 28 | required: true 29 | - type: input 30 | id: project-version 31 | attributes: 32 | label: "'arduino/compile-sketches' version" 33 | description: | 34 | Which version of `arduino/compile-sketches` are you using? 35 | _This should be the most recent version available._ 36 | validations: 37 | required: true 38 | - type: textarea 39 | id: additional 40 | attributes: 41 | label: Additional context 42 | description: Add any additional information here. 43 | validations: 44 | required: false 45 | - type: checkboxes 46 | id: checklist 47 | attributes: 48 | label: Issue checklist 49 | description: Please double-check that you have done each of the following things before submitting the issue. 50 | options: 51 | - label: I searched for previous reports in [the issue tracker](https://github.com/arduino/compile-sketches/issues?q=) 52 | required: true 53 | - label: I verified the problem still occurs when using the latest version 54 | required: true 55 | - label: My report contains all necessary details 56 | required: true 57 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml/.yamllint.yml 2 | # See: https://yamllint.readthedocs.io/en/stable/configuration.html 3 | # The code style defined in this file is the official standardized style to be used in all Arduino tooling projects and 4 | # should not be modified. 5 | # Note: Rules disabled solely because they are redundant to Prettier are marked with a "Prettier" comment. 6 | 7 | rules: 8 | braces: 9 | level: error 10 | forbid: non-empty 11 | min-spaces-inside: -1 # Prettier 12 | max-spaces-inside: -1 # Prettier 13 | min-spaces-inside-empty: -1 # Prettier 14 | max-spaces-inside-empty: -1 # Prettier 15 | brackets: 16 | level: error 17 | forbid: non-empty 18 | min-spaces-inside: -1 # Prettier 19 | max-spaces-inside: -1 # Prettier 20 | min-spaces-inside-empty: -1 # Prettier 21 | max-spaces-inside-empty: -1 # Prettier 22 | colons: disable # Prettier 23 | commas: disable # Prettier 24 | comments: disable # Prettier 25 | comments-indentation: disable # Prettier 26 | document-end: disable # Prettier 27 | document-start: disable 28 | empty-lines: disable # Prettier 29 | empty-values: disable 30 | hyphens: disable # Prettier 31 | indentation: disable # Prettier 32 | key-duplicates: disable # Prettier 33 | key-ordering: disable 34 | line-length: 35 | level: warning 36 | max: 120 37 | allow-non-breakable-words: true 38 | allow-non-breakable-inline-mappings: true 39 | new-line-at-end-of-file: disable # Prettier 40 | new-lines: disable # Prettier 41 | octal-values: 42 | level: warning 43 | forbid-implicit-octal: true 44 | forbid-explicit-octal: false 45 | quoted-strings: disable 46 | trailing-spaces: disable # Prettier 47 | truthy: 48 | level: error 49 | allowed-values: 50 | - "true" 51 | - "false" 52 | - "on" # Used by GitHub Actions as a workflow key. 53 | check-keys: true 54 | 55 | yaml-files: 56 | # Source: https://github.com/ikatyang/linguist-languages/blob/master/data/YAML.json (used by Prettier) 57 | - ".clang-format" 58 | - ".clang-tidy" 59 | - ".gemrc" 60 | - ".yamllint" 61 | - "glide.lock" 62 | - "*.yml" 63 | - "*.mir" 64 | - "*.reek" 65 | - "*.rviz" 66 | - "*.sublime-syntax" 67 | - "*.syntax" 68 | - "*.yaml" 69 | - "*.yaml-tmlanguage" 70 | - "*.yaml.sed" 71 | - "*.yml.mysql" 72 | 73 | ignore: | 74 | /.git/ 75 | __pycache__/ 76 | node_modules/ 77 | -------------------------------------------------------------------------------- /.github/workflows/check-files-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-files-task.md 2 | name: Check Files 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | pull_request: 9 | schedule: 10 | # Run periodically to catch breakage caused by external changes. 11 | - cron: "0 8 * * THU" 12 | workflow_dispatch: 13 | repository_dispatch: 14 | 15 | jobs: 16 | run-determination: 17 | runs-on: ubuntu-latest 18 | permissions: {} 19 | outputs: 20 | result: ${{ steps.determination.outputs.result }} 21 | steps: 22 | - name: Determine if the rest of the workflow should run 23 | id: determination 24 | run: | 25 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 26 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 27 | if [[ 28 | "${{ github.event_name }}" != "create" || 29 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 30 | ]]; then 31 | # Run the other jobs. 32 | RESULT="true" 33 | else 34 | # There is no need to run the other jobs. 35 | RESULT="false" 36 | fi 37 | 38 | echo "result=$RESULT" >> $GITHUB_OUTPUT 39 | 40 | check-filenames: 41 | needs: run-determination 42 | if: needs.run-determination.outputs.result == 'true' 43 | runs-on: ubuntu-latest 44 | permissions: 45 | contents: read 46 | 47 | steps: 48 | - name: Checkout repository 49 | uses: actions/checkout@v6 50 | 51 | - name: Install Task 52 | uses: arduino/setup-task@v2 53 | with: 54 | repo-token: ${{ secrets.GITHUB_TOKEN }} 55 | version: 3.x 56 | 57 | - name: Check filenames 58 | run: task --silent general:check-filenames 59 | 60 | check-symlinks: 61 | needs: run-determination 62 | if: needs.run-determination.outputs.result == 'true' 63 | runs-on: ubuntu-latest 64 | permissions: 65 | contents: read 66 | 67 | steps: 68 | - name: Checkout repository 69 | uses: actions/checkout@v6 70 | 71 | - name: Install Task 72 | uses: arduino/setup-task@v2 73 | with: 74 | repo-token: ${{ secrets.GITHUB_TOKEN }} 75 | version: 3.x 76 | 77 | - name: Check symlinks 78 | run: task --silent general:check-symlinks 79 | -------------------------------------------------------------------------------- /.github/workflows/check-action-metadata-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-action-metadata-task.md 2 | name: Check Action Metadata 3 | 4 | # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-action-metadata-task.ya?ml" 10 | - "action.ya?ml" 11 | - ".npmrc" 12 | - "package.json" 13 | - "package-lock.json" 14 | - "Taskfile.ya?ml" 15 | pull_request: 16 | paths: 17 | - ".github/workflows/check-action-metadata-task.ya?ml" 18 | - "action.ya?ml" 19 | - ".npmrc" 20 | - "package.json" 21 | - "package-lock.json" 22 | - "Taskfile.ya?ml" 23 | schedule: 24 | # Run every Tuesday at 8 AM UTC to catch breakage from changes to the JSON schema. 25 | - cron: "0 8 * * TUE" 26 | workflow_dispatch: 27 | repository_dispatch: 28 | 29 | jobs: 30 | run-determination: 31 | runs-on: ubuntu-latest 32 | permissions: {} 33 | outputs: 34 | result: ${{ steps.determination.outputs.result }} 35 | steps: 36 | - name: Determine if the rest of the workflow should run 37 | id: determination 38 | run: | 39 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 40 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 41 | if [[ 42 | "${{ github.event_name }}" != "create" || 43 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 44 | ]]; then 45 | # Run the other jobs. 46 | RESULT="true" 47 | else 48 | # There is no need to run the other jobs. 49 | RESULT="false" 50 | fi 51 | 52 | echo "result=$RESULT" >> $GITHUB_OUTPUT 53 | 54 | validate: 55 | needs: run-determination 56 | if: needs.run-determination.outputs.result == 'true' 57 | runs-on: ubuntu-latest 58 | permissions: 59 | contents: read 60 | 61 | steps: 62 | - name: Checkout repository 63 | uses: actions/checkout@v6 64 | 65 | - name: Setup Node.js 66 | uses: actions/setup-node@v6 67 | with: 68 | node-version-file: package.json 69 | 70 | - name: Install Task 71 | uses: arduino/setup-task@v2 72 | with: 73 | repo-token: ${{ secrets.GITHUB_TOKEN }} 74 | version: 3.x 75 | 76 | - name: Validate action.yml 77 | run: task --silent action:validate 78 | -------------------------------------------------------------------------------- /.github/workflows/check-toc-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-toc-task.md 2 | name: Check ToC 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-toc-task.ya?ml" 10 | - ".npmrc" 11 | - "package.json" 12 | - "package-lock.json" 13 | - "README.md" 14 | pull_request: 15 | paths: 16 | - ".github/workflows/check-toc-task.ya?ml" 17 | - ".npmrc" 18 | - "package.json" 19 | - "package-lock.json" 20 | - "README.md" 21 | schedule: 22 | # Run periodically to catch breakage caused by external changes. 23 | - cron: "0 3 * * WED" 24 | workflow_dispatch: 25 | repository_dispatch: 26 | 27 | jobs: 28 | run-determination: 29 | runs-on: ubuntu-latest 30 | permissions: {} 31 | outputs: 32 | result: ${{ steps.determination.outputs.result }} 33 | steps: 34 | - name: Determine if the rest of the workflow should run 35 | id: determination 36 | run: | 37 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 38 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 39 | if [[ 40 | "${{ github.event_name }}" != "create" || 41 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 42 | ]]; then 43 | # Run the other jobs. 44 | RESULT="true" 45 | else 46 | # There is no need to run the other jobs. 47 | RESULT="false" 48 | fi 49 | 50 | echo "result=$RESULT" >> $GITHUB_OUTPUT 51 | 52 | check: 53 | name: ${{ matrix.file.name }} 54 | needs: run-determination 55 | if: needs.run-determination.outputs.result == 'true' 56 | runs-on: ubuntu-latest 57 | permissions: 58 | contents: read 59 | 60 | strategy: 61 | fail-fast: false 62 | 63 | matrix: 64 | file: 65 | - name: README.md 66 | # Max ToC depth, for use with the markdown-toc --maxdepth flag. 67 | maxdepth: 5 68 | 69 | steps: 70 | - name: Checkout repository 71 | uses: actions/checkout@v6 72 | 73 | - name: Setup Node.js 74 | uses: actions/setup-node@v6 75 | with: 76 | node-version-file: package.json 77 | 78 | - name: Install Task 79 | uses: arduino/setup-task@v2 80 | with: 81 | repo-token: ${{ secrets.GITHUB_TOKEN }} 82 | version: 3.x 83 | 84 | - name: Rebuild ToC 85 | run: | 86 | task markdown:toc \ 87 | FILE_PATH="${{ github.workspace }}/${{ matrix.file.name }}" \ 88 | MAX_DEPTH=${{ matrix.file.maxdepth }} 89 | 90 | - name: Check ToC 91 | run: git diff --color --exit-code 92 | -------------------------------------------------------------------------------- /.github/workflows/check-general-formatting-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-general-formatting-task.md 2 | name: Check General Formatting 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | pull_request: 9 | schedule: 10 | # Run every Tuesday at 8 AM UTC to catch breakage caused by changes to tools. 11 | - cron: "0 8 * * TUE" 12 | workflow_dispatch: 13 | repository_dispatch: 14 | 15 | jobs: 16 | run-determination: 17 | runs-on: ubuntu-latest 18 | permissions: {} 19 | outputs: 20 | result: ${{ steps.determination.outputs.result }} 21 | steps: 22 | - name: Determine if the rest of the workflow should run 23 | id: determination 24 | run: | 25 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 26 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 27 | if [[ 28 | "${{ github.event_name }}" != "create" || 29 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 30 | ]]; then 31 | # Run the other jobs. 32 | RESULT="true" 33 | else 34 | # There is no need to run the other jobs. 35 | RESULT="false" 36 | fi 37 | 38 | echo "result=$RESULT" >> $GITHUB_OUTPUT 39 | 40 | check: 41 | needs: run-determination 42 | if: needs.run-determination.outputs.result == 'true' 43 | runs-on: ubuntu-latest 44 | permissions: 45 | contents: read 46 | 47 | steps: 48 | - name: Set environment variables 49 | run: | 50 | # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable 51 | echo "EC_INSTALL_PATH=${{ runner.temp }}/editorconfig-checker" >> "$GITHUB_ENV" 52 | 53 | - name: Checkout repository 54 | uses: actions/checkout@v6 55 | 56 | - name: Install Task 57 | uses: arduino/setup-task@v2 58 | with: 59 | repo-token: ${{ secrets.GITHUB_TOKEN }} 60 | version: 3.x 61 | 62 | - name: Download latest editorconfig-checker release binary package 63 | id: download 64 | uses: MrOctopus/download-asset-action@1.1 65 | with: 66 | repository: editorconfig-checker/editorconfig-checker 67 | excludes: prerelease, draft 68 | asset: linux-amd64.tar.gz 69 | target: ${{ env.EC_INSTALL_PATH }} 70 | 71 | - name: Install editorconfig-checker 72 | run: | 73 | cd "${{ env.EC_INSTALL_PATH }}" 74 | tar --extract --file="${{ steps.download.outputs.name }}" 75 | # Give the binary a standard name 76 | mv "${{ env.EC_INSTALL_PATH }}/bin/ec-linux-amd64" "${{ env.EC_INSTALL_PATH }}/bin/ec" 77 | # Add installation to PATH: 78 | # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-system-path 79 | echo "${{ env.EC_INSTALL_PATH }}/bin" >> "$GITHUB_PATH" 80 | 81 | - name: Check formatting 82 | run: task --silent general:check-formatting 83 | -------------------------------------------------------------------------------- /.github/workflows/check-poetry-task.yml: -------------------------------------------------------------------------------- 1 | name: Check Poetry 2 | 3 | on: 4 | create: 5 | push: 6 | paths: 7 | - ".github/workflows/check-poetry-task.ya?ml" 8 | - "**/poetry.lock" 9 | - "**/pyproject.toml" 10 | - "Taskfile.ya?ml" 11 | pull_request: 12 | paths: 13 | - ".github/workflows/check-poetry-task.ya?ml" 14 | - "**/poetry.lock" 15 | - "**/pyproject.toml" 16 | - "Taskfile.ya?ml" 17 | schedule: 18 | # Run periodically to catch breakage caused by external changes. 19 | - cron: "0 11 * * THU" 20 | workflow_dispatch: 21 | repository_dispatch: 22 | 23 | jobs: 24 | run-determination: 25 | runs-on: ubuntu-latest 26 | permissions: {} 27 | outputs: 28 | result: ${{ steps.determination.outputs.result }} 29 | steps: 30 | - name: Determine if the rest of the workflow should run 31 | id: determination 32 | run: | 33 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 34 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 35 | if [[ 36 | "${{ github.event_name }}" != "create" || 37 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 38 | ]]; then 39 | # Run the other jobs. 40 | RESULT="true" 41 | else 42 | # There is no need to run the other jobs. 43 | RESULT="false" 44 | fi 45 | 46 | echo "result=$RESULT" >> $GITHUB_OUTPUT 47 | 48 | validate: 49 | needs: run-determination 50 | if: needs.run-determination.outputs.result == 'true' 51 | runs-on: ubuntu-latest 52 | permissions: 53 | contents: read 54 | 55 | steps: 56 | - name: Checkout repository 57 | uses: actions/checkout@v6 58 | 59 | - name: Install Python 60 | uses: actions/setup-python@v6 61 | with: 62 | python-version-file: pyproject.toml 63 | 64 | - name: Install Task 65 | uses: arduino/setup-task@v2 66 | with: 67 | repo-token: ${{ secrets.GITHUB_TOKEN }} 68 | version: 3.x 69 | 70 | - name: Validate pyproject.toml 71 | run: | 72 | task \ 73 | --silent \ 74 | poetry:validate 75 | 76 | check-sync: 77 | needs: run-determination 78 | if: needs.run-determination.outputs.result == 'true' 79 | runs-on: ubuntu-latest 80 | permissions: 81 | contents: read 82 | 83 | steps: 84 | - name: Checkout repository 85 | uses: actions/checkout@v6 86 | 87 | - name: Install Python 88 | uses: actions/setup-python@v6 89 | with: 90 | python-version-file: pyproject.toml 91 | 92 | - name: Install Task 93 | uses: arduino/setup-task@v2 94 | with: 95 | repo-token: ${{ secrets.GITHUB_TOKEN }} 96 | version: 3.x 97 | 98 | - name: Sync lockfile 99 | run: | 100 | task \ 101 | --silent \ 102 | poetry:sync 103 | 104 | - name: Check if lockfile was out of sync 105 | run: | 106 | git diff \ 107 | --color \ 108 | --exit-code \ 109 | poetry.lock 110 | -------------------------------------------------------------------------------- /.github/workflows/check-taskfiles.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-taskfiles.md 2 | name: Check Taskfiles 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-taskfiles.ya?ml" 10 | - ".npmrc" 11 | - "package.json" 12 | - "package-lock.json" 13 | - "**/Taskfile.ya?ml" 14 | pull_request: 15 | paths: 16 | - ".github/workflows/check-taskfiles.ya?ml" 17 | - ".npmrc" 18 | - "package.json" 19 | - "package-lock.json" 20 | - "**/Taskfile.ya?ml" 21 | schedule: 22 | # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. 23 | - cron: "0 8 * * TUE" 24 | workflow_dispatch: 25 | repository_dispatch: 26 | 27 | jobs: 28 | run-determination: 29 | runs-on: ubuntu-latest 30 | permissions: {} 31 | outputs: 32 | result: ${{ steps.determination.outputs.result }} 33 | steps: 34 | - name: Determine if the rest of the workflow should run 35 | id: determination 36 | run: | 37 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 38 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 39 | if [[ 40 | "${{ github.event_name }}" != "create" || 41 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 42 | ]]; then 43 | # Run the other jobs. 44 | RESULT="true" 45 | else 46 | # There is no need to run the other jobs. 47 | RESULT="false" 48 | fi 49 | 50 | echo "result=$RESULT" >> $GITHUB_OUTPUT 51 | 52 | validate: 53 | name: Validate ${{ matrix.file }} 54 | needs: run-determination 55 | if: needs.run-determination.outputs.result == 'true' 56 | runs-on: ubuntu-latest 57 | permissions: 58 | contents: read 59 | 60 | strategy: 61 | fail-fast: false 62 | 63 | matrix: 64 | file: 65 | - ./**/Taskfile.yml 66 | 67 | steps: 68 | - name: Checkout repository 69 | uses: actions/checkout@v6 70 | 71 | - name: Setup Node.js 72 | uses: actions/setup-node@v6 73 | with: 74 | node-version-file: package.json 75 | 76 | - name: Download JSON schema for Taskfiles 77 | id: download-schema 78 | uses: carlosperate/download-file-action@v2 79 | with: 80 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json 81 | file-url: https://taskfile.dev/schema.json 82 | location: ${{ runner.temp }}/taskfile-schema 83 | 84 | - name: Install JSON schema validator 85 | run: npm install 86 | 87 | - name: Validate ${{ matrix.file }} 88 | run: | 89 | # See: https://github.com/ajv-validator/ajv-cli#readme 90 | npx \ 91 | --package=ajv-cli \ 92 | --package=ajv-formats \ 93 | ajv validate \ 94 | --all-errors \ 95 | --strict=false \ 96 | -c ajv-formats \ 97 | -s "${{ steps.download-schema.outputs.file-path }}" \ 98 | -d "${{ matrix.file }}" 99 | -------------------------------------------------------------------------------- /.github/workflows/check-python-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-python-task.md 2 | name: Check Python 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-python-task.ya?ml" 10 | - "**/.flake8" 11 | - "**/poetry.lock" 12 | - "**/pyproject.toml" 13 | - "**/setup.cfg" 14 | - "Taskfile.ya?ml" 15 | - "**/tox.ini" 16 | - "**.py" 17 | pull_request: 18 | paths: 19 | - ".github/workflows/check-python-task.ya?ml" 20 | - "**/.flake8" 21 | - "**/poetry.lock" 22 | - "**/pyproject.toml" 23 | - "**/setup.cfg" 24 | - "Taskfile.ya?ml" 25 | - "**/tox.ini" 26 | - "**.py" 27 | schedule: 28 | # Run periodically to catch breakage caused by external changes. 29 | - cron: "0 8 * * WED" 30 | workflow_dispatch: 31 | repository_dispatch: 32 | 33 | jobs: 34 | run-determination: 35 | runs-on: ubuntu-latest 36 | permissions: {} 37 | outputs: 38 | result: ${{ steps.determination.outputs.result }} 39 | steps: 40 | - name: Determine if the rest of the workflow should run 41 | id: determination 42 | run: | 43 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 44 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 45 | if [[ 46 | "${{ github.event_name }}" != "create" || 47 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 48 | ]]; then 49 | # Run the other jobs. 50 | RESULT="true" 51 | else 52 | # There is no need to run the other jobs. 53 | RESULT="false" 54 | fi 55 | 56 | echo "result=$RESULT" >> $GITHUB_OUTPUT 57 | 58 | lint: 59 | needs: run-determination 60 | if: needs.run-determination.outputs.result == 'true' 61 | runs-on: ubuntu-latest 62 | permissions: 63 | contents: read 64 | 65 | steps: 66 | - name: Checkout repository 67 | uses: actions/checkout@v6 68 | 69 | - name: Install Python 70 | uses: actions/setup-python@v6 71 | with: 72 | python-version-file: pyproject.toml 73 | 74 | - name: Install Task 75 | uses: arduino/setup-task@v2 76 | with: 77 | repo-token: ${{ secrets.GITHUB_TOKEN }} 78 | version: 3.x 79 | 80 | - name: Run flake8 81 | uses: liskin/gh-problem-matcher-wrap@v3 82 | with: 83 | linters: flake8 84 | run: task python:lint 85 | 86 | formatting: 87 | needs: run-determination 88 | if: needs.run-determination.outputs.result == 'true' 89 | runs-on: ubuntu-latest 90 | permissions: 91 | contents: read 92 | 93 | steps: 94 | - name: Checkout repository 95 | uses: actions/checkout@v6 96 | 97 | - name: Install Python 98 | uses: actions/setup-python@v6 99 | with: 100 | python-version-file: pyproject.toml 101 | 102 | - name: Install Task 103 | uses: arduino/setup-task@v2 104 | with: 105 | repo-token: ${{ secrets.GITHUB_TOKEN }} 106 | version: 3.x 107 | 108 | - name: Format Python code 109 | run: task python:format 110 | 111 | - name: Check formatting 112 | run: git diff --color --exit-code 113 | -------------------------------------------------------------------------------- /.github/workflows/check-markdown-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-markdown-task.md 2 | name: Check Markdown 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-markdown-task.ya?ml" 10 | - ".markdown-link-check.json" 11 | - ".npmrc" 12 | - "package.json" 13 | - "package-lock.json" 14 | - "Taskfile.ya?ml" 15 | - "**/.markdownlint*" 16 | - "**.mdx?" 17 | - "**.mkdn" 18 | - "**.mdown" 19 | - "**.markdown" 20 | pull_request: 21 | paths: 22 | - ".github/workflows/check-markdown-task.ya?ml" 23 | - ".markdown-link-check.json" 24 | - ".npmrc" 25 | - "package.json" 26 | - "package-lock.json" 27 | - "Taskfile.ya?ml" 28 | - "**/.markdownlint*" 29 | - "**.mdx?" 30 | - "**.mkdn" 31 | - "**.mdown" 32 | - "**.markdown" 33 | schedule: 34 | # Run every Tuesday at 8 AM UTC to catch breakage caused by external changes. 35 | - cron: "0 8 * * TUE" 36 | workflow_dispatch: 37 | repository_dispatch: 38 | 39 | jobs: 40 | run-determination: 41 | runs-on: ubuntu-latest 42 | permissions: {} 43 | outputs: 44 | result: ${{ steps.determination.outputs.result }} 45 | steps: 46 | - name: Determine if the rest of the workflow should run 47 | id: determination 48 | run: | 49 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 50 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 51 | if [[ 52 | "${{ github.event_name }}" != "create" || 53 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 54 | ]]; then 55 | # Run the other jobs. 56 | RESULT="true" 57 | else 58 | # There is no need to run the other jobs. 59 | RESULT="false" 60 | fi 61 | 62 | echo "result=$RESULT" >> $GITHUB_OUTPUT 63 | 64 | lint: 65 | needs: run-determination 66 | if: needs.run-determination.outputs.result == 'true' 67 | runs-on: ubuntu-latest 68 | permissions: 69 | contents: read 70 | 71 | steps: 72 | - name: Checkout repository 73 | uses: actions/checkout@v6 74 | 75 | - name: Setup Node.js 76 | uses: actions/setup-node@v6 77 | with: 78 | node-version-file: package.json 79 | 80 | - name: Initialize markdownlint-cli problem matcher 81 | uses: xt0rted/markdownlint-problem-matcher@v3 82 | 83 | - name: Install Task 84 | uses: arduino/setup-task@v2 85 | with: 86 | repo-token: ${{ secrets.GITHUB_TOKEN }} 87 | version: 3.x 88 | 89 | - name: Lint 90 | run: task markdown:lint 91 | 92 | links: 93 | needs: run-determination 94 | if: needs.run-determination.outputs.result == 'true' 95 | runs-on: ubuntu-latest 96 | permissions: 97 | contents: read 98 | 99 | steps: 100 | - name: Checkout repository 101 | uses: actions/checkout@v6 102 | 103 | - name: Setup Node.js 104 | uses: actions/setup-node@v6 105 | with: 106 | node-version-file: package.json 107 | 108 | - name: Install Task 109 | uses: arduino/setup-task@v2 110 | with: 111 | repo-token: ${{ secrets.GITHUB_TOKEN }} 112 | version: 3.x 113 | 114 | - name: Check links 115 | run: task --silent markdown:check-links 116 | -------------------------------------------------------------------------------- /.github/workflows/check-npm-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-npm-task.md 2 | name: Check npm 3 | 4 | # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-npm-task.ya?ml" 10 | - "**/.npmrc" 11 | - "**/package.json" 12 | - "**/package-lock.json" 13 | - "Taskfile.ya?ml" 14 | pull_request: 15 | paths: 16 | - ".github/workflows/check-npm-task.ya?ml" 17 | - "**/.npmrc" 18 | - "**/package.json" 19 | - "**/package-lock.json" 20 | - "Taskfile.ya?ml" 21 | schedule: 22 | # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. 23 | - cron: "0 8 * * TUE" 24 | workflow_dispatch: 25 | repository_dispatch: 26 | 27 | jobs: 28 | run-determination: 29 | runs-on: ubuntu-latest 30 | permissions: {} 31 | outputs: 32 | result: ${{ steps.determination.outputs.result }} 33 | steps: 34 | - name: Determine if the rest of the workflow should run 35 | id: determination 36 | run: | 37 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 38 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 39 | if [[ 40 | "${{ github.event_name }}" != "create" || 41 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 42 | ]]; then 43 | # Run the other jobs. 44 | RESULT="true" 45 | else 46 | # There is no need to run the other jobs. 47 | RESULT="false" 48 | fi 49 | 50 | echo "result=$RESULT" >> $GITHUB_OUTPUT 51 | 52 | validate: 53 | name: validate (${{ matrix.project.path }}) 54 | needs: run-determination 55 | if: needs.run-determination.outputs.result == 'true' 56 | runs-on: ubuntu-latest 57 | permissions: 58 | contents: read 59 | 60 | strategy: 61 | fail-fast: false 62 | matrix: 63 | project: 64 | - path: . 65 | 66 | steps: 67 | - name: Checkout repository 68 | uses: actions/checkout@v6 69 | 70 | - name: Setup Node.js 71 | uses: actions/setup-node@v6 72 | with: 73 | node-version-file: package.json 74 | 75 | - name: Install Task 76 | uses: arduino/setup-task@v2 77 | with: 78 | repo-token: ${{ secrets.GITHUB_TOKEN }} 79 | version: 3.x 80 | 81 | - name: Validate package.json 82 | run: task --silent npm:validate PROJECT_PATH="${{ matrix.project.path }}" 83 | 84 | check-sync: 85 | name: check-sync (${{ matrix.project.path }}) 86 | needs: run-determination 87 | if: needs.run-determination.outputs.result == 'true' 88 | runs-on: ubuntu-latest 89 | permissions: 90 | contents: read 91 | 92 | strategy: 93 | fail-fast: false 94 | matrix: 95 | project: 96 | - path: . 97 | 98 | steps: 99 | - name: Checkout repository 100 | uses: actions/checkout@v6 101 | 102 | - name: Setup Node.js 103 | uses: actions/setup-node@v6 104 | with: 105 | node-version-file: package.json 106 | 107 | - name: Install Task 108 | uses: arduino/setup-task@v2 109 | with: 110 | repo-token: ${{ secrets.GITHUB_TOKEN }} 111 | version: 3.x 112 | 113 | - name: Install npm dependencies 114 | run: task npm:install-deps PROJECT_PATH="${{ matrix.project.path }}" 115 | 116 | - name: Check package-lock.json 117 | run: git diff --color --exit-code "${{ matrix.project.path }}/package-lock.json" 118 | -------------------------------------------------------------------------------- /.github/workflows/check-yaml-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-yaml-task.md 2 | name: Check YAML 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".yamllint*" 10 | - "poetry.lock" 11 | - "pyproject.toml" 12 | # Source: https://github.com/ikatyang/linguist-languages/blob/master/data/YAML.json (used by Prettier) 13 | - "**/.clang-format" 14 | - "**/.clang-tidy" 15 | - "**/.gemrc" 16 | - "**/glide.lock" 17 | - "**.ya?ml*" 18 | - "**.mir" 19 | - "**.reek" 20 | - "**.rviz" 21 | - "**.sublime-syntax" 22 | - "**.syntax" 23 | pull_request: 24 | paths: 25 | - ".yamllint*" 26 | - "poetry.lock" 27 | - "pyproject.toml" 28 | # Source: https://github.com/ikatyang/linguist-languages/blob/master/data/YAML.json (used by Prettier) 29 | - "**/.clang-format" 30 | - "**/.clang-tidy" 31 | - "**/.gemrc" 32 | - "**/glide.lock" 33 | - "**.ya?ml*" 34 | - "**.mir" 35 | - "**.reek" 36 | - "**.rviz" 37 | - "**.sublime-syntax" 38 | - "**.syntax" 39 | schedule: 40 | # Run periodically to catch breakage caused by external changes. 41 | - cron: "0 9 * * WED" 42 | workflow_dispatch: 43 | repository_dispatch: 44 | 45 | jobs: 46 | run-determination: 47 | runs-on: ubuntu-latest 48 | permissions: {} 49 | outputs: 50 | result: ${{ steps.determination.outputs.result }} 51 | steps: 52 | - name: Determine if the rest of the workflow should run 53 | id: determination 54 | run: | 55 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 56 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 57 | if [[ 58 | "${{ github.event_name }}" != "create" || 59 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 60 | ]]; then 61 | # Run the other jobs. 62 | RESULT="true" 63 | else 64 | # There is no need to run the other jobs. 65 | RESULT="false" 66 | fi 67 | 68 | echo "result=$RESULT" >> $GITHUB_OUTPUT 69 | 70 | check: 71 | name: ${{ matrix.configuration.name }} 72 | needs: run-determination 73 | if: needs.run-determination.outputs.result == 'true' 74 | runs-on: ubuntu-latest 75 | permissions: 76 | contents: read 77 | 78 | strategy: 79 | fail-fast: false 80 | 81 | matrix: 82 | configuration: 83 | - name: Generate problem matcher output 84 | # yamllint's "github" output type produces annotated diffs, but is not useful to humans reading the log. 85 | format: github 86 | # The other matrix job is used to set the result, so this job is configured to always pass. 87 | continue-on-error: true 88 | - name: Check formatting 89 | # yamllint's "colored" output type is most suitable for humans reading the log. 90 | format: colored 91 | continue-on-error: false 92 | 93 | steps: 94 | - name: Checkout repository 95 | uses: actions/checkout@v6 96 | 97 | - name: Install Python 98 | uses: actions/setup-python@v6 99 | with: 100 | python-version-file: pyproject.toml 101 | 102 | - name: Install Task 103 | uses: arduino/setup-task@v2 104 | with: 105 | repo-token: ${{ secrets.GITHUB_TOKEN }} 106 | version: 3.x 107 | 108 | - name: Check YAML 109 | continue-on-error: ${{ matrix.configuration.continue-on-error }} 110 | run: task yaml:lint YAMLLINT_FORMAT=${{ matrix.configuration.format }} 111 | -------------------------------------------------------------------------------- /.github/workflows/test-python-poetry-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/test-python-poetry-task.md 2 | name: Test Python 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/test-python-poetry-task.ya?ml" 10 | - ".github/.?codecov.ya?ml" 11 | - "dev/.?codecov.ya?ml" 12 | - ".?codecov.ya?ml" 13 | - "Taskfile.ya?ml" 14 | - "poetry.lock" 15 | - "pyproject.toml" 16 | - "compilesketches/tests/**" 17 | - "**.py" 18 | - "**/pytest.ini" 19 | pull_request: 20 | paths: 21 | - ".github/workflows/test-python-poetry-task.ya?ml" 22 | - ".github/.?codecov.ya?ml" 23 | - "dev/.?codecov.ya?ml" 24 | - ".?codecov.ya?ml" 25 | - "Taskfile.ya?ml" 26 | - "poetry.lock" 27 | - "pyproject.toml" 28 | - "compilesketches/tests/**" 29 | - "**.py" 30 | - "**/pytest.ini" 31 | schedule: 32 | # Run periodically to catch breakage caused by external changes. 33 | - cron: "0 12 * * WED" 34 | workflow_dispatch: 35 | repository_dispatch: 36 | 37 | jobs: 38 | run-determination: 39 | runs-on: ubuntu-latest 40 | outputs: 41 | result: ${{ steps.determination.outputs.result }} 42 | permissions: {} 43 | steps: 44 | - name: Determine if the rest of the workflow should run 45 | id: determination 46 | run: | 47 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 48 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 49 | if [[ 50 | "${{ github.event_name }}" != "create" || 51 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 52 | ]]; then 53 | # Run the other jobs. 54 | RESULT="true" 55 | else 56 | # There is no need to run the other jobs. 57 | RESULT="false" 58 | fi 59 | 60 | echo "result=$RESULT" >> $GITHUB_OUTPUT 61 | 62 | test: 63 | needs: run-determination 64 | if: needs.run-determination.outputs.result == 'true' 65 | runs-on: ubuntu-latest 66 | permissions: 67 | contents: read 68 | 69 | steps: 70 | - name: Checkout repository 71 | uses: actions/checkout@v6 72 | 73 | - name: Install Python 74 | uses: actions/setup-python@v6 75 | with: 76 | python-version-file: pyproject.toml 77 | 78 | - name: Install Task 79 | uses: arduino/setup-task@v2 80 | with: 81 | repo-token: ${{ secrets.GITHUB_TOKEN }} 82 | version: 3.x 83 | 84 | - name: Run tests 85 | uses: liskin/gh-problem-matcher-wrap@v3 86 | with: 87 | linters: pytest 88 | run: task python:test 89 | 90 | - name: Display code coverage report 91 | run: task python:coverage-report 92 | 93 | # A token is used to avoid intermittent spurious job failures caused by rate limiting. 94 | - name: Set up Codecov upload token 95 | run: | 96 | if [[ "${{ github.repository }}" == "arduino/compile-sketches" ]]; then 97 | # In order to avoid uploads of data from forks, only use the token for runs in the parent repo. 98 | # Token is intentionally exposed. 99 | # See: https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954 100 | CODECOV_TOKEN="0c2a8127-e253-4812-8b83-6dcc586c2bf7" 101 | else 102 | # codecov/codecov-action does unauthenticated upload if empty string is passed via the `token` input. 103 | CODECOV_TOKEN="" 104 | fi 105 | echo "CODECOV_TOKEN=$CODECOV_TOKEN" >> "$GITHUB_ENV" 106 | 107 | - name: Upload coverage report to Codecov 108 | uses: codecov/codecov-action@v3 109 | with: 110 | fail_ci_if_error: true 111 | file: coverage.xml 112 | token: ${{ env.CODECOV_TOKEN }} 113 | -------------------------------------------------------------------------------- /.github/workflows/check-license.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-license.md 2 | name: Check License 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-license.ya?ml" 10 | # See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file 11 | - "[cC][oO][pP][yY][iI][nN][gG]*" 12 | - "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*" 13 | - "[lL][iI][cC][eE][nN][cCsS][eE]*" 14 | - "[oO][fF][lL]*" 15 | - "[pP][aA][tT][eE][nN][tT][sS]*" 16 | pull_request: 17 | paths: 18 | - ".github/workflows/check-license.ya?ml" 19 | - "[cC][oO][pP][yY][iI][nN][gG]*" 20 | - "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*" 21 | - "[lL][iI][cC][eE][nN][cCsS][eE]*" 22 | - "[oO][fF][lL]*" 23 | - "[pP][aA][tT][eE][nN][tT][sS]*" 24 | schedule: 25 | # Run periodically to catch breakage caused by external changes. 26 | - cron: "0 6 * * WED" 27 | workflow_dispatch: 28 | repository_dispatch: 29 | 30 | jobs: 31 | run-determination: 32 | runs-on: ubuntu-latest 33 | permissions: {} 34 | outputs: 35 | result: ${{ steps.determination.outputs.result }} 36 | steps: 37 | - name: Determine if the rest of the workflow should run 38 | id: determination 39 | run: | 40 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 41 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 42 | if [[ 43 | "${{ github.event_name }}" != "create" || 44 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 45 | ]]; then 46 | # Run the other jobs. 47 | RESULT="true" 48 | else 49 | # There is no need to run the other jobs. 50 | RESULT="false" 51 | fi 52 | 53 | echo "result=$RESULT" >> $GITHUB_OUTPUT 54 | 55 | check-license: 56 | name: ${{ matrix.check-license.path }} 57 | needs: run-determination 58 | if: needs.run-determination.outputs.result == 'true' 59 | runs-on: ubuntu-latest 60 | permissions: 61 | contents: read 62 | 63 | strategy: 64 | fail-fast: false 65 | 66 | matrix: 67 | check-license: 68 | - path: ./ 69 | expected-filename: LICENSE.txt 70 | # SPDX identifier: https://spdx.org/licenses/ 71 | expected-type: GPL-3.0 72 | 73 | steps: 74 | - name: Checkout repository 75 | uses: actions/checkout@v6 76 | 77 | - name: Install Ruby 78 | uses: ruby/setup-ruby@v1 79 | with: 80 | ruby-version: ruby # Install latest version 81 | 82 | - name: Install licensee 83 | run: gem install licensee 84 | 85 | - name: Check license file for ${{ matrix.check-license.path }} 86 | run: | 87 | EXIT_STATUS=0 88 | 89 | # Go into folder path 90 | cd ./${{ matrix.check-license.path }} 91 | 92 | # See: https://github.com/licensee/licensee 93 | LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)" 94 | 95 | DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')" 96 | echo "Detected license file: $DETECTED_LICENSE_FILE" 97 | if [ "$DETECTED_LICENSE_FILE" != "\"${{ matrix.check-license.expected-filename }}\"" ]; then 98 | echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: ${{ matrix.check-license.expected-filename }}" 99 | EXIT_STATUS=1 100 | fi 101 | 102 | DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')" 103 | echo "Detected license type: $DETECTED_LICENSE_TYPE" 104 | if [ "$DETECTED_LICENSE_TYPE" != "\"${{ matrix.check-license.expected-type }}\"" ]; then 105 | echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${{ matrix.check-license.expected-type }}\"" 106 | EXIT_STATUS=1 107 | fi 108 | 109 | exit $EXIT_STATUS 110 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "Compile Arduino Sketches" 2 | description: >- 3 | Checks whether Arduino sketches will compile and produces a report of data from the compilations 4 | inputs: 5 | cli-version: 6 | description: >- 7 | Version of Arduino CLI to use when building 8 | default: "latest" 9 | required: true 10 | fqbn: 11 | description: >- 12 | Full qualified board name, with Boards Manager URL if needed 13 | default: "arduino:avr:uno" 14 | required: true 15 | libraries: 16 | description: >- 17 | YAML-format list of library dependencies to install 18 | default: "- source-path: ./" 19 | required: true 20 | platforms: 21 | description: >- 22 | YAML-format list of platform dependencies to install 23 | default: "" 24 | required: true 25 | sketch-paths: 26 | description: >- 27 | YAML-format list of paths containing sketches to compile. 28 | default: "- examples" 29 | required: true 30 | cli-compile-flags: 31 | description: >- 32 | YAML-format list of flags to add to the Arduino CLI sketch compilation command. 33 | default: "" 34 | required: false 35 | verbose: 36 | description: >- 37 | Set to true to show verbose output in the log 38 | default: "false" 39 | required: true 40 | sketches-report-path: 41 | description: >- 42 | Path in which to save a JSON formatted file containing data from the sketch compilations 43 | default: "sketches-reports" 44 | required: true 45 | github-token: 46 | description: >- 47 | GitHub access token used to get information from the GitHub API. 48 | 49 | Only needed if you are using the deltas report feature in a private repository. 50 | default: "" 51 | required: true 52 | enable-deltas-report: 53 | description: >- 54 | Set to true to cause the action to determine the change in memory usage and compiler warnings of the compiled 55 | sketches between the head and base refs of a PR and the immediate parent commit of a push 56 | default: "false" 57 | required: true 58 | enable-warnings-report: 59 | description: >- 60 | Set to true to cause the action to record the compiler warning count for each sketch compilation in the sketches 61 | report 62 | default: "false" 63 | required: true 64 | 65 | runs: 66 | using: composite 67 | steps: 68 | # User installations of external Python package platform dependencies will be located here. 69 | - name: Get system Python "user site-packages" path 70 | id: system-user-site-packages 71 | shell: bash 72 | run: | 73 | # Get system Python "user site-packages" path. 74 | echo "path=$(python -m site --user-site)" >> $GITHUB_OUTPUT 75 | 76 | - name: Install Python 77 | uses: actions/setup-python@v6 78 | with: 79 | python-version-file: ${{ github.action_path }}/pyproject.toml 80 | 81 | - name: Action setup 82 | shell: bash 83 | working-directory: ${{ github.action_path }} 84 | run: | 85 | echo "::group::Action setup" 86 | 87 | # Install Poetry. 88 | pipx install \ 89 | --python "$(which python)" \ 90 | "poetry==$( \ 91 | yq \ 92 | --input-format toml \ 93 | --output-format yaml \ 94 | '.tool.poetry.group.pipx.dependencies.poetry' \ 95 | < pyproject.toml 96 | )" 97 | 98 | # Install Python dependencies. 99 | poetry install \ 100 | --only main,external 101 | 102 | # Make user-installed Python packages available to platforms. 103 | readonly PYTHON_ENVIRONMENT_PATH="$( 104 | poetry env info \ 105 | --path 106 | )" 107 | readonly VENV_SITE_PACKAGES_PATH="$( 108 | poetry run \ 109 | python -c \ 110 | 'import site; print(site.getsitepackages()[0])' 111 | )" 112 | echo \ 113 | "${{ steps.system-user-site-packages.outputs.path }}" > \ 114 | "${VENV_SITE_PACKAGES_PATH}/system-user-site-packages.pth" 115 | 116 | # Terminate action setup group 117 | echo "::endgroup::" 118 | 119 | - name: Run script 120 | shell: bash 121 | env: 122 | INPUT_CLI-VERSION: ${{ inputs.cli-version }} 123 | INPUT_FQBN: ${{ inputs.fqbn }} 124 | INPUT_LIBRARIES: ${{ inputs.libraries }} 125 | INPUT_PLATFORMS: ${{ inputs.platforms }} 126 | INPUT_SKETCH-PATHS: ${{ inputs.sketch-paths }} 127 | INPUT_CLI-COMPILE-FLAGS: ${{ inputs.cli-compile-flags }} 128 | INPUT_VERBOSE: ${{ inputs.verbose }} 129 | INPUT_GITHUB-TOKEN: ${{ inputs.github-token }} 130 | INPUT_ENABLE-DELTAS-REPORT: ${{ inputs.enable-deltas-report }} 131 | INPUT_ENABLE-WARNINGS-REPORT: ${{ inputs.enable-warnings-report }} 132 | INPUT_SKETCHES-REPORT-PATH: ${{ inputs.sketches-report-path }} 133 | working-directory: ${{ github.action_path }} 134 | run: | 135 | # Run action 136 | poetry run \ 137 | python compilesketches/compilesketches.py 138 | -------------------------------------------------------------------------------- /docs/FAQ.md: -------------------------------------------------------------------------------- 1 | # Frequently Asked Questions 2 | 3 | ## How can I install dependencies of a boards platform? 4 | 5 | ### Managed Dependencies 6 | 7 | The Arduino **Boards Manager** system installs tool dependencies along with a platform. When you specify a [**Boards Manager**-sourced platform dependency](../README.md#boards-manager) via the action's [`platforms` input](../README.md#platforms) the managed platform dependencies are installed automatically. 8 | 9 | If an alternative [platform dependency source](../README.md#supported-platform-sources) is used this automatic tool dependency installation does not occur. The convenient way to install the tool dependencies in this case is to install a **Boards Manager**-sourced platform that has a dependency on the required tools in addition to the target platform from the alternative source. 10 | 11 | --- 12 | 13 | **Example:** 14 | 15 | ```yaml 16 | - uses: arduino/compile-sketches@v1 17 | with: 18 | platforms: | 19 | # Use Boards Manager to install the latest release of the platform to get the toolchain. 20 | - name: arduino:avr 21 | # Overwrite the Boards Manager installation with the development version of the platform. 22 | - source-url: https://github.com/arduino/ArduinoCore-avr.git 23 | name: arduino:avr 24 | ``` 25 | 26 | --- 27 | 28 | ### External Dependencies 29 | 30 | Arduino boards platforms typically bundle all dependencies. However, there are some platforms that require the user to manually install dependencies on their system in order to use the platform. 31 | 32 | The **arduino/compile-sketches** action runs in the same environment as the rest of the steps of the [workflow job](https://docs.github.com/actions/using-jobs/using-jobs-in-a-workflow), which means you can simply perform the dependency installation in a prior [step](https://docs.github.com/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idsteps) of the job. 33 | 34 | --- 35 | 36 | **Example:** 37 | 38 | ```yaml 39 | - run: 40 | - uses: arduino/compile-sketches@v1 41 | ``` 42 | 43 | --- 44 | 45 | #### Python Packages 46 | 47 | The **arduino/compile-sketches** action uses a Python [virtual environment](https://docs.python.org/glossary.html#term-virtual-environment). In order to enable user installation of Python [package](https://docs.python.org/glossary.html#term-package) dependencies of boards platforms, the packages installed in the "[user site-packages](https://peps.python.org/pep-0370/)" folder are included in this virtual environment. 48 | 49 | In order to be certain your installation of a package dependency will be available to the platform, add the [`--ignore-installed`](https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-ignore-installed) and [`--user`](https://pip.pypa.io/en/stable/cli/pip_install/#install-user) flags to the [**pip**](https://pip.pypa.io/) command used to install the package. 50 | 51 | --- 52 | 53 | **Example:** 54 | 55 | ```yaml 56 | - run: pip install --ignore-installed --user pyserial 57 | - uses: arduino/compile-sketches@v1 58 | ``` 59 | 60 | --- 61 | 62 | ## How can I install a platform or library dependency from an external private repository? 63 | 64 | The **arduino/compile-sketches** action supports installing platform and library dependencies of the sketches by cloning the repository specified via the `source-url` field of the [`platforms`](../README.md#platforms) or [`libraries`](../README.md#libraries) inputs. 65 | 66 | With a public repository, the dependency definition will look something like this: 67 | 68 | ```yaml 69 | libraries: | 70 | - source-url: https://github.com/arduino-libraries/Servo.git 71 | ``` 72 | 73 | However, if `arduino-libraries/Servo` was a private repository the installation of this library by the action would fail: 74 | 75 | ```text 76 | fatal: could not read Username for 'https://github.com': No such device or address 77 | ``` 78 | 79 | In this case is necessary to configure the repository URL to provide the authentication required for **Git** to clone the repository, as documented [**here**](https://git-scm.com/docs/git-clone#_git_urls). For private GitHub repositories, the following URL format can be used: 80 | 81 | ```text 82 | https://@github.com/.git 83 | ``` 84 | 85 | where `` is a "[personal access token](https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#about-personal-access-tokens)" with `repo` scope from the account of a user with access to the private repository. 86 | 87 | --- 88 | 89 | **ⓘ** You might find it convenient to create the token under a ["machine user" account](https://docs.github.com/authentication/connecting-to-github-with-ssh/managing-deploy-keys#machine-users). 90 | 91 | --- 92 | 93 | In order to avoid leaking the token, it must be stored in a [secret](https://docs.github.com/actions/security-guides/using-secrets-in-github-actions), and that secret [referenced](https://docs.github.com/actions/security-guides/using-secrets-in-github-actions#using-secrets-in-a-workflow) in the URL. 94 | 95 | --- 96 | 97 | **Example:** 98 | 99 | ```yaml 100 | - uses: arduino/compile-sketches@v1 101 | with: 102 | libraries: | 103 | - source-url: https://${{ secrets.REPO_SCOPE_TOKEN }}@github.com/octocat/SomePrivateLib.git 104 | ``` 105 | 106 | --- 107 | 108 | **ⓘ** The automatically generated [`GITHUB_TOKEN` secret](https://docs.github.com/actions/security-guides/automatic-token-authentication#about-the-github_token-secret) can not be used for this purpose as it lacks the necessary permissions. 109 | 110 | --- 111 | -------------------------------------------------------------------------------- /.github/workflows/testdata/reports/all-inputs/arduino-avr-uno.json: -------------------------------------------------------------------------------- 1 | { 2 | "commit_hash": "d2ed774ec1f37e6e497b6d629963cbc79632e9f9", 3 | "commit_url": "https://github.com/arduino/compile-sketches/commit/d2ed774ec1f37e6e497b6d629963cbc79632e9f9", 4 | "boards": [ 5 | { 6 | "board": "arduino:avr:uno", 7 | "sketches": [ 8 | { 9 | "name": ".github/workflows/testdata/sketches/BareMinimum", 10 | "compilation_success": true, 11 | "sizes": [ 12 | { 13 | "name": "flash", 14 | "maximum": 32256, 15 | "current": { 16 | "absolute": 444, 17 | "relative": 1.38 18 | }, 19 | "previous": { 20 | "absolute": 444, 21 | "relative": 1.38 22 | }, 23 | "delta": { 24 | "absolute": 0, 25 | "relative": 0.0 26 | } 27 | }, 28 | { 29 | "name": "RAM for global variables", 30 | "maximum": 2048, 31 | "current": { 32 | "absolute": 9, 33 | "relative": 0.44 34 | }, 35 | "previous": { 36 | "absolute": 9, 37 | "relative": 0.44 38 | }, 39 | "delta": { 40 | "absolute": 0, 41 | "relative": 0.0 42 | } 43 | } 44 | ], 45 | "warnings": { 46 | "current": { 47 | "absolute": 0 48 | }, 49 | "previous": { 50 | "absolute": 0 51 | }, 52 | "delta": { 53 | "absolute": 0 54 | } 55 | } 56 | }, 57 | { 58 | "name": ".github/workflows/testdata/sketches/ServoLibrary", 59 | "compilation_success": true, 60 | "sizes": [ 61 | { 62 | "name": "flash", 63 | "maximum": 32256, 64 | "current": { 65 | "absolute": 888, 66 | "relative": 2.75 67 | }, 68 | "previous": { 69 | "absolute": 888, 70 | "relative": 2.75 71 | }, 72 | "delta": { 73 | "absolute": 0, 74 | "relative": 0.0 75 | } 76 | }, 77 | { 78 | "name": "RAM for global variables", 79 | "maximum": 2048, 80 | "current": { 81 | "absolute": 46, 82 | "relative": 2.25 83 | }, 84 | "previous": { 85 | "absolute": 46, 86 | "relative": 2.25 87 | }, 88 | "delta": { 89 | "absolute": 0, 90 | "relative": 0.0 91 | } 92 | } 93 | ], 94 | "warnings": { 95 | "current": { 96 | "absolute": 0 97 | }, 98 | "previous": { 99 | "absolute": 0 100 | }, 101 | "delta": { 102 | "absolute": 0 103 | } 104 | } 105 | }, 106 | { 107 | "name": ".github/workflows/testdata/sketches/TestCompileFlags", 108 | "compilation_success": true, 109 | "sizes": [ 110 | { 111 | "name": "flash", 112 | "maximum": 32256, 113 | "current": { 114 | "absolute": 444, 115 | "relative": 1.38 116 | }, 117 | "previous": { 118 | "absolute": 444, 119 | "relative": 1.38 120 | }, 121 | "delta": { 122 | "absolute": 0, 123 | "relative": 0.0 124 | } 125 | }, 126 | { 127 | "name": "RAM for global variables", 128 | "maximum": 2048, 129 | "current": { 130 | "absolute": 9, 131 | "relative": 0.44 132 | }, 133 | "previous": { 134 | "absolute": 9, 135 | "relative": 0.44 136 | }, 137 | "delta": { 138 | "absolute": 0, 139 | "relative": 0.0 140 | } 141 | } 142 | ], 143 | "warnings": { 144 | "current": { 145 | "absolute": 1 146 | }, 147 | "previous": { 148 | "absolute": 1 149 | }, 150 | "delta": { 151 | "absolute": 0 152 | } 153 | } 154 | } 155 | ], 156 | "sizes": [ 157 | { 158 | "name": "flash", 159 | "maximum": 32256, 160 | "delta": { 161 | "absolute": { 162 | "minimum": 0, 163 | "maximum": 0 164 | }, 165 | "relative": { 166 | "minimum": 0.0, 167 | "maximum": 0.0 168 | } 169 | } 170 | }, 171 | { 172 | "name": "RAM for global variables", 173 | "maximum": 2048, 174 | "delta": { 175 | "absolute": { 176 | "minimum": 0, 177 | "maximum": 0 178 | }, 179 | "relative": { 180 | "minimum": 0.0, 181 | "maximum": 0.0 182 | } 183 | } 184 | } 185 | ], 186 | "warnings": { 187 | "delta": { 188 | "absolute": { 189 | "minimum": 0, 190 | "maximum": 0 191 | } 192 | } 193 | } 194 | } 195 | ] 196 | } 197 | -------------------------------------------------------------------------------- /.github/workflows/testdata/reports/all-inputs/esp8266-esp8266-huzzah.json: -------------------------------------------------------------------------------- 1 | { 2 | "commit_hash": "d2ed774ec1f37e6e497b6d629963cbc79632e9f9", 3 | "commit_url": "https://github.com/arduino/compile-sketches/commit/d2ed774ec1f37e6e497b6d629963cbc79632e9f9", 4 | "boards": [ 5 | { 6 | "board": "esp8266:esp8266:huzzah", 7 | "sketches": [ 8 | { 9 | "name": ".github/workflows/testdata/sketches/BareMinimum", 10 | "compilation_success": true, 11 | "sizes": [ 12 | { 13 | "name": "flash", 14 | "maximum": 1044464, 15 | "current": { 16 | "absolute": 256684, 17 | "relative": 24.58 18 | }, 19 | "previous": { 20 | "absolute": 256684, 21 | "relative": 24.58 22 | }, 23 | "delta": { 24 | "absolute": 0, 25 | "relative": 0.0 26 | } 27 | }, 28 | { 29 | "name": "RAM for global variables", 30 | "maximum": 81920, 31 | "current": { 32 | "absolute": 26776, 33 | "relative": 32.69 34 | }, 35 | "previous": { 36 | "absolute": 26776, 37 | "relative": 32.69 38 | }, 39 | "delta": { 40 | "absolute": 0, 41 | "relative": 0.0 42 | } 43 | } 44 | ], 45 | "warnings": { 46 | "current": { 47 | "absolute": 0 48 | }, 49 | "previous": { 50 | "absolute": 0 51 | }, 52 | "delta": { 53 | "absolute": 0 54 | } 55 | } 56 | }, 57 | { 58 | "name": ".github/workflows/testdata/sketches/ServoLibrary", 59 | "compilation_success": true, 60 | "sizes": [ 61 | { 62 | "name": "flash", 63 | "maximum": 1044464, 64 | "current": { 65 | "absolute": 256684, 66 | "relative": 24.58 67 | }, 68 | "previous": { 69 | "absolute": 256684, 70 | "relative": 24.58 71 | }, 72 | "delta": { 73 | "absolute": 0, 74 | "relative": 0.0 75 | } 76 | }, 77 | { 78 | "name": "RAM for global variables", 79 | "maximum": 81920, 80 | "current": { 81 | "absolute": 26776, 82 | "relative": 32.69 83 | }, 84 | "previous": { 85 | "absolute": 26776, 86 | "relative": 32.69 87 | }, 88 | "delta": { 89 | "absolute": 0, 90 | "relative": 0.0 91 | } 92 | } 93 | ], 94 | "warnings": { 95 | "current": { 96 | "absolute": 0 97 | }, 98 | "previous": { 99 | "absolute": 0 100 | }, 101 | "delta": { 102 | "absolute": 0 103 | } 104 | } 105 | }, 106 | { 107 | "name": ".github/workflows/testdata/sketches/TestCompileFlags", 108 | "compilation_success": true, 109 | "sizes": [ 110 | { 111 | "name": "flash", 112 | "maximum": 1044464, 113 | "current": { 114 | "absolute": 256684, 115 | "relative": 24.58 116 | }, 117 | "previous": { 118 | "absolute": 256684, 119 | "relative": 24.58 120 | }, 121 | "delta": { 122 | "absolute": 0, 123 | "relative": 0.0 124 | } 125 | }, 126 | { 127 | "name": "RAM for global variables", 128 | "maximum": 81920, 129 | "current": { 130 | "absolute": 26776, 131 | "relative": 32.69 132 | }, 133 | "previous": { 134 | "absolute": 26776, 135 | "relative": 32.69 136 | }, 137 | "delta": { 138 | "absolute": 0, 139 | "relative": 0.0 140 | } 141 | } 142 | ], 143 | "warnings": { 144 | "current": { 145 | "absolute": 1 146 | }, 147 | "previous": { 148 | "absolute": 1 149 | }, 150 | "delta": { 151 | "absolute": 0 152 | } 153 | } 154 | } 155 | ], 156 | "sizes": [ 157 | { 158 | "name": "flash", 159 | "maximum": 1044464, 160 | "delta": { 161 | "absolute": { 162 | "minimum": 0, 163 | "maximum": 0 164 | }, 165 | "relative": { 166 | "minimum": 0.0, 167 | "maximum": 0.0 168 | } 169 | } 170 | }, 171 | { 172 | "name": "RAM for global variables", 173 | "maximum": 81920, 174 | "delta": { 175 | "absolute": { 176 | "minimum": 0, 177 | "maximum": 0 178 | }, 179 | "relative": { 180 | "minimum": 0.0, 181 | "maximum": 0.0 182 | } 183 | } 184 | } 185 | ], 186 | "warnings": { 187 | "delta": { 188 | "absolute": { 189 | "minimum": 0, 190 | "maximum": 0 191 | } 192 | } 193 | } 194 | } 195 | ] 196 | } 197 | -------------------------------------------------------------------------------- /.github/workflows/sync-labels-npm.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels-npm.md 2 | name: Sync Labels 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | push: 7 | paths: 8 | - ".github/workflows/sync-labels-npm.ya?ml" 9 | - ".github/label-configuration-files/*.ya?ml" 10 | - ".npmrc" 11 | - "package.json" 12 | - "package-lock.json" 13 | pull_request: 14 | paths: 15 | - ".github/workflows/sync-labels-npm.ya?ml" 16 | - ".github/label-configuration-files/*.ya?ml" 17 | - ".npmrc" 18 | - "package.json" 19 | - "package-lock.json" 20 | schedule: 21 | # Run daily at 8 AM UTC to sync with changes to shared label configurations. 22 | - cron: "0 8 * * *" 23 | workflow_dispatch: 24 | repository_dispatch: 25 | 26 | env: 27 | CONFIGURATIONS_FOLDER: .github/label-configuration-files 28 | CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- 29 | 30 | jobs: 31 | check: 32 | runs-on: ubuntu-latest 33 | permissions: 34 | contents: read 35 | 36 | steps: 37 | - name: Checkout repository 38 | uses: actions/checkout@v6 39 | 40 | - name: Setup Node.js 41 | uses: actions/setup-node@v6 42 | with: 43 | node-version-file: package.json 44 | 45 | - name: Download JSON schema for labels configuration file 46 | id: download-schema 47 | uses: carlosperate/download-file-action@v2 48 | with: 49 | file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json 50 | location: ${{ runner.temp }}/label-configuration-schema 51 | 52 | - name: Install JSON schema validator 53 | run: npm install 54 | 55 | - name: Validate local labels configuration 56 | run: | 57 | # See: https://github.com/ajv-validator/ajv-cli#readme 58 | npx \ 59 | --package=ajv-cli \ 60 | --package=ajv-formats \ 61 | ajv validate \ 62 | --all-errors \ 63 | -c ajv-formats \ 64 | -s "${{ steps.download-schema.outputs.file-path }}" \ 65 | -d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}" 66 | 67 | download: 68 | needs: check 69 | runs-on: ubuntu-latest 70 | permissions: {} 71 | 72 | strategy: 73 | matrix: 74 | filename: 75 | # Filenames of the shared configurations to apply to the repository in addition to the local configuration. 76 | # https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels 77 | - universal.yml 78 | - tooling.yml 79 | 80 | steps: 81 | - name: Download 82 | uses: carlosperate/download-file-action@v2 83 | with: 84 | file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }} 85 | 86 | - name: Pass configuration files to next job via workflow artifact 87 | uses: actions/upload-artifact@v6 88 | with: 89 | path: | 90 | *.yaml 91 | *.yml 92 | if-no-files-found: error 93 | name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}${{ matrix.filename }} 94 | 95 | sync: 96 | needs: download 97 | runs-on: ubuntu-latest 98 | permissions: 99 | contents: read 100 | issues: write 101 | 102 | steps: 103 | - name: Set environment variables 104 | run: | 105 | # See: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable 106 | echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV" 107 | 108 | - name: Determine whether to dry run 109 | id: dry-run 110 | if: > 111 | github.event_name == 'pull_request' || 112 | ( 113 | ( 114 | github.event_name == 'push' || 115 | github.event_name == 'workflow_dispatch' 116 | ) && 117 | github.ref != format('refs/heads/{0}', github.event.repository.default_branch) 118 | ) 119 | run: | 120 | # Use of this flag in the github-label-sync command will cause it to only check the validity of the 121 | # configuration. 122 | echo "flag=--dry-run" >> $GITHUB_OUTPUT 123 | 124 | - name: Checkout repository 125 | uses: actions/checkout@v6 126 | 127 | - name: Download configuration file artifacts 128 | uses: actions/download-artifact@v7 129 | with: 130 | merge-multiple: true 131 | pattern: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* 132 | path: ${{ env.CONFIGURATIONS_FOLDER }} 133 | 134 | - name: Remove unneeded artifacts 135 | uses: geekyeggo/delete-artifact@v5 136 | with: 137 | name: ${{ env.CONFIGURATIONS_ARTIFACT_PREFIX }}* 138 | 139 | - name: Setup Node.js 140 | uses: actions/setup-node@v6 141 | with: 142 | node-version-file: package.json 143 | 144 | - name: Merge label configuration files 145 | run: | 146 | # Merge all configuration files 147 | shopt -s extglob 148 | cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}" 149 | 150 | - name: Install github-label-sync 151 | run: npm install 152 | 153 | - name: Sync labels 154 | env: 155 | GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} 156 | run: | 157 | # See: https://github.com/Financial-Times/github-label-sync 158 | npx \ 159 | github-label-sync \ 160 | --labels "${{ env.MERGED_CONFIGURATION_PATH }}" \ 161 | ${{ steps.dry-run.outputs.flag }} \ 162 | ${{ github.repository }} 163 | -------------------------------------------------------------------------------- /.github/workflows/check-prettier-formatting-task.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-prettier-formatting-task.md 2 | name: Check Prettier Formatting 3 | 4 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 5 | on: 6 | create: 7 | push: 8 | paths: 9 | - ".github/workflows/check-prettier-formatting-task.ya?ml" 10 | - ".npmrc" 11 | - "Taskfile.ya?ml" 12 | - "**/.prettierignore" 13 | - "**/.prettierrc*" 14 | # CSS 15 | - "**.css" 16 | - "**.wxss" 17 | # PostCSS 18 | - "**.pcss" 19 | - "**.postcss" 20 | # Less 21 | - "**.less" 22 | # SCSS 23 | - "**.scss" 24 | # GraphQL 25 | - "**.graphqls?" 26 | - "**.gql" 27 | # handlebars 28 | - "**.handlebars" 29 | - "**.hbs" 30 | # HTML 31 | - "**.mjml" 32 | - "**.html?" 33 | - "**.html.hl" 34 | - "**.st" 35 | - "**.xht" 36 | - "**.xhtml" 37 | # Vue 38 | - "**.vue" 39 | # JavaScript 40 | - "**.flow" 41 | - "**._?jsb?" 42 | - "**.bones" 43 | - "**.cjs" 44 | - "**.es6?" 45 | - "**.frag" 46 | - "**.gs" 47 | - "**.jake" 48 | - "**.jscad" 49 | - "**.jsfl" 50 | - "**.js[ms]" 51 | - "**.[mn]js" 52 | - "**.pac" 53 | - "**.wxs" 54 | - "**.[xs]s?js" 55 | - "**.xsjslib" 56 | # JSX 57 | - "**.jsx" 58 | # TypeScript 59 | - "**.ts" 60 | # TSX 61 | - "**.tsx" 62 | # JSON 63 | - "**/.eslintrc" 64 | - "**.json" 65 | - "**.avsc" 66 | - "**.geojson" 67 | - "**.gltf" 68 | - "**.har" 69 | - "**.ice" 70 | - "**.JSON-tmLanguage" 71 | - "**.mcmeta" 72 | - "**.tfstate" 73 | - "**.topojson" 74 | - "**.webapp" 75 | - "**.webmanifest" 76 | - "**.yyp?" 77 | # JSONC 78 | - "**/.babelrc" 79 | - "**/.jscsrc" 80 | - "**/.js[hl]intrc" 81 | - "**.jsonc" 82 | - "**.sublime-*" 83 | # JSON5 84 | - "**.json5" 85 | # Markdown 86 | - "**.mdx?" 87 | - "**.markdown" 88 | - "**.mk?down" 89 | - "**.mdwn" 90 | - "**.mkdn?" 91 | - "**.ronn" 92 | - "**.workbook" 93 | # YAML 94 | - "**/.clang-format" 95 | - "**/.clang-tidy" 96 | - "**/.gemrc" 97 | - "**/glide.lock" 98 | - "**.ya?ml*" 99 | - "**.mir" 100 | - "**.reek" 101 | - "**.rviz" 102 | - "**.sublime-syntax" 103 | - "**.syntax" 104 | pull_request: 105 | paths: 106 | - ".github/workflows/check-prettier-formatting-task.ya?ml" 107 | - ".npmrc" 108 | - "Taskfile.ya?ml" 109 | - "**/.prettierignore" 110 | - "**/.prettierrc*" 111 | # CSS 112 | - "**.css" 113 | - "**.wxss" 114 | # PostCSS 115 | - "**.pcss" 116 | - "**.postcss" 117 | # Less 118 | - "**.less" 119 | # SCSS 120 | - "**.scss" 121 | # GraphQL 122 | - "**.graphqls?" 123 | - "**.gql" 124 | # handlebars 125 | - "**.handlebars" 126 | - "**.hbs" 127 | # HTML 128 | - "**.mjml" 129 | - "**.html?" 130 | - "**.html.hl" 131 | - "**.st" 132 | - "**.xht" 133 | - "**.xhtml" 134 | # Vue 135 | - "**.vue" 136 | # JavaScript 137 | - "**.flow" 138 | - "**._?jsb?" 139 | - "**.bones" 140 | - "**.cjs" 141 | - "**.es6?" 142 | - "**.frag" 143 | - "**.gs" 144 | - "**.jake" 145 | - "**.jscad" 146 | - "**.jsfl" 147 | - "**.js[ms]" 148 | - "**.[mn]js" 149 | - "**.pac" 150 | - "**.wxs" 151 | - "**.[xs]s?js" 152 | - "**.xsjslib" 153 | # JSX 154 | - "**.jsx" 155 | # TypeScript 156 | - "**.ts" 157 | # TSX 158 | - "**.tsx" 159 | # JSON 160 | - "**/.eslintrc" 161 | - "**.json" 162 | - "**.avsc" 163 | - "**.geojson" 164 | - "**.gltf" 165 | - "**.har" 166 | - "**.ice" 167 | - "**.JSON-tmLanguage" 168 | - "**.mcmeta" 169 | - "**.tfstate" 170 | - "**.topojson" 171 | - "**.webapp" 172 | - "**.webmanifest" 173 | - "**.yyp?" 174 | # JSONC 175 | - "**/.babelrc" 176 | - "**/.jscsrc" 177 | - "**/.js[hl]intrc" 178 | - "**.jsonc" 179 | - "**.sublime-*" 180 | # JSON5 181 | - "**.json5" 182 | # Markdown 183 | - "**.mdx?" 184 | - "**.markdown" 185 | - "**.mk?down" 186 | - "**.mdwn" 187 | - "**.mkdn?" 188 | - "**.ronn" 189 | - "**.workbook" 190 | # YAML 191 | - "**/.clang-format" 192 | - "**/.clang-tidy" 193 | - "**/.gemrc" 194 | - "**/glide.lock" 195 | - "**.ya?ml*" 196 | - "**.mir" 197 | - "**.reek" 198 | - "**.rviz" 199 | - "**.sublime-syntax" 200 | - "**.syntax" 201 | schedule: 202 | # Run periodically to catch breakage caused by external changes. 203 | - cron: "0 4 * * WED" 204 | workflow_dispatch: 205 | repository_dispatch: 206 | 207 | jobs: 208 | run-determination: 209 | runs-on: ubuntu-latest 210 | permissions: {} 211 | outputs: 212 | result: ${{ steps.determination.outputs.result }} 213 | steps: 214 | - name: Determine if the rest of the workflow should run 215 | id: determination 216 | run: | 217 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 218 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 219 | if [[ 220 | "${{ github.event_name }}" != "create" || 221 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 222 | ]]; then 223 | # Run the other jobs. 224 | RESULT="true" 225 | else 226 | # There is no need to run the other jobs. 227 | RESULT="false" 228 | fi 229 | 230 | echo "result=$RESULT" >> $GITHUB_OUTPUT 231 | 232 | check: 233 | needs: run-determination 234 | if: needs.run-determination.outputs.result == 'true' 235 | runs-on: ubuntu-latest 236 | permissions: 237 | contents: read 238 | 239 | steps: 240 | - name: Checkout repository 241 | uses: actions/checkout@v6 242 | 243 | - name: Setup Node.js 244 | uses: actions/setup-node@v6 245 | with: 246 | node-version-file: package.json 247 | 248 | - name: Install Task 249 | uses: arduino/setup-task@v2 250 | with: 251 | repo-token: ${{ secrets.GITHUB_TOKEN }} 252 | version: 3.x 253 | 254 | - name: Format with Prettier 255 | run: task general:format-prettier 256 | 257 | - name: Check formatting 258 | run: git diff --color --exit-code 259 | -------------------------------------------------------------------------------- /.github/workflows/test-integration.yml: -------------------------------------------------------------------------------- 1 | name: Run integration tests 2 | 3 | on: 4 | create: 5 | 6 | pull_request: 7 | paths: 8 | - ".github/workflows/test-integration.yml" 9 | - ".github/workflows/testdata/**" 10 | - "poetry.lock" 11 | - "pyproject.toml" 12 | - "action.yml" 13 | - "compilesketches/**" 14 | 15 | push: 16 | paths: 17 | - ".github/workflows/test-integration.yml" 18 | - ".github/workflows/testdata/**" 19 | - "poetry.lock" 20 | - "pyproject.toml" 21 | - "action.yml" 22 | - "compilesketches/**" 23 | 24 | repository_dispatch: 25 | 26 | schedule: 27 | # Run periodically to catch breakage caused by external changes. 28 | - cron: "0 12 * * THU" 29 | 30 | workflow_dispatch: 31 | 32 | env: 33 | SKETCHES_REPORTS_PATH: sketches-reports 34 | TESTDATA_PLATFORMS_PATH: .github/workflows/testdata/platforms 35 | TESTDATA_SKETCHES_PATH: .github/workflows/testdata/sketches 36 | TESTDATA_REPORTS_PATH: .github/workflows/testdata/reports 37 | 38 | jobs: 39 | run-determination: 40 | runs-on: ubuntu-latest 41 | outputs: 42 | result: ${{ steps.determination.outputs.result }} 43 | steps: 44 | - name: Determine if the rest of the workflow should run 45 | id: determination 46 | run: | 47 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 48 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 49 | if [[ 50 | "${{ github.event_name }}" != "create" || 51 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 52 | ]]; then 53 | # Run the other jobs. 54 | RESULT="true" 55 | else 56 | # There is no need to run the other jobs. 57 | RESULT="false" 58 | fi 59 | 60 | echo "result=$RESULT" >> $GITHUB_OUTPUT 61 | 62 | default-inputs: 63 | needs: run-determination 64 | if: needs.run-determination.outputs.result == 'true' 65 | runs-on: ubuntu-latest 66 | 67 | steps: 68 | - name: Checkout Servo library 69 | uses: actions/checkout@v6 70 | with: 71 | repository: arduino-libraries/servo 72 | ref: 1.1.7 73 | 74 | - name: Checkout local repo 75 | uses: actions/checkout@v6 76 | with: 77 | # Must be checked out to a subfolder to not interfere with the checked out library under test 78 | path: extras/compile-sketches 79 | 80 | - name: Run action with default input values 81 | # Use action from local path 82 | uses: ./extras/compile-sketches 83 | 84 | all-inputs: 85 | needs: run-determination 86 | if: needs.run-determination.outputs.result == 'true' 87 | runs-on: ubuntu-latest 88 | 89 | strategy: 90 | fail-fast: false 91 | 92 | matrix: 93 | board: 94 | - fqbn: arduino:avr:uno 95 | artifact-name-suffix: arduino-avr-uno 96 | platforms: | 97 | - name: arduino:avr 98 | version: 1.8.3 99 | libraries: | 100 | - name: Servo 101 | version: 1.1.7 102 | # Board that requires Boards Manager URL 103 | - fqbn: esp8266:esp8266:huzzah 104 | artifact-name-suffix: esp8266-esp8266-huzzah 105 | platforms: | 106 | - name: esp8266:esp8266 107 | source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json 108 | version: 2.7.4 109 | libraries: | 110 | # The official Servo library is not compatible with ESP8266, but that platform has a bundled Servo lib 111 | # so there are no library dependencies 112 | [] 113 | 114 | steps: 115 | - name: Checkout 116 | uses: actions/checkout@v6 117 | 118 | - name: Run action 119 | # Use action from local path 120 | uses: ./ 121 | with: 122 | cli-version: 0.15.1 123 | github-token: ${{ secrets.GITHUB_TOKEN }} 124 | platforms: ${{ matrix.board.platforms }} 125 | fqbn: ${{ matrix.board.fqbn }} 126 | libraries: ${{ matrix.board.libraries }} 127 | sketch-paths: | 128 | - ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum 129 | - ${{ env.TESTDATA_SKETCHES_PATH }}/ServoLibrary 130 | - ${{ env.TESTDATA_SKETCHES_PATH }}/TestCompileFlags 131 | cli-compile-flags: | 132 | - --build-property 133 | - compiler.cpp.extra_flags="-DSTRING_MACRO="hello world"" -DINT_MACRO=2 -DFLAG_MACRO 134 | - --export-binaries 135 | enable-deltas-report: true 136 | enable-warnings-report: true 137 | sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} 138 | verbose: true 139 | 140 | - name: Verify --export-binaries flag was used by compilation command 141 | run: | 142 | [ -d ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum/build ] 143 | 144 | - name: Set report artifact name 145 | id: report-artifact-prefix 146 | run: | 147 | echo "report-artifact-prefix=${{ github.job }}" >> "$GITHUB_OUTPUT" 148 | 149 | - name: Save sketches report as workflow artifact 150 | uses: actions/upload-artifact@v6 151 | with: 152 | path: sketches-reports 153 | name: ${{ steps.report-artifact-prefix.outputs.report-artifact-prefix }}-${{ matrix.board.artifact-name-suffix }} 154 | 155 | outputs: 156 | report-artifact-prefix: ${{ steps.report-artifact-prefix.outputs.report-artifact-prefix }} 157 | 158 | multiple-steps: 159 | name: multiple-steps (${{ matrix.board.source-type }}) 160 | needs: run-determination 161 | if: needs.run-determination.outputs.result == 'true' 162 | runs-on: ubuntu-latest 163 | 164 | strategy: 165 | fail-fast: false 166 | 167 | matrix: 168 | board: 169 | - source-type: manager 170 | fqbn: arduino:avr:uno 171 | platforms: | 172 | - name: arduino:avr 173 | version: 1.8.3 174 | libraries: | 175 | - name: Servo 176 | version: 1.1.7 177 | - source-type: path 178 | fqbn: arduino:avr:uno 179 | platforms: | 180 | - name: arduino:avr 181 | version: 1.8.3 182 | - source-path: extras/ArduinoCore-avr 183 | name: arduino:avr 184 | libraries: | 185 | - source-path: ./ 186 | name: Servo 187 | - source-type: repo 188 | fqbn: arduino:avr:uno 189 | platforms: | 190 | - name: arduino:avr 191 | version: 1.8.3 192 | - source-url: https://github.com/arduino/ArduinoCore-avr.git 193 | name: arduino:avr 194 | version: 1.8.3 195 | libraries: | 196 | - source-url: https://github.com/arduino-libraries/Servo.git 197 | name: Servo 198 | version: 1.1.7 199 | - source-type: archive 200 | fqbn: arduino:avr:uno 201 | platforms: | 202 | - name: arduino:avr 203 | version: 1.8.3 204 | - source-url: https://github.com/arduino/ArduinoCore-avr/archive/refs/tags/1.8.3.zip 205 | name: arduino:avr 206 | libraries: | 207 | - source-url: https://github.com/arduino-libraries/Servo/archive/refs/tags/1.1.7.zip 208 | name: Servo 209 | 210 | steps: 211 | - name: Checkout library 212 | uses: actions/checkout@v6 213 | with: 214 | repository: arduino-libraries/Servo 215 | ref: 1.1.7 216 | 217 | - name: Checkout platform 218 | if: matrix.board.source-type == 'path' 219 | uses: actions/checkout@v6 220 | with: 221 | repository: arduino/ArduinoCore-avr 222 | ref: 1.8.3 223 | path: extras/ArduinoCore-avr 224 | 225 | - name: Checkout local repo 226 | uses: actions/checkout@v6 227 | with: 228 | path: extras/compile-sketches 229 | 230 | - name: Run action 231 | # Use action from local path 232 | uses: ./extras/compile-sketches 233 | with: 234 | platforms: ${{ matrix.board.platforms }} 235 | fqbn: ${{ matrix.board.fqbn }} 236 | libraries: ${{ matrix.board.libraries }} 237 | sketch-paths: | 238 | - examples/Sweep 239 | 240 | - name: Run action again 241 | uses: ./extras/compile-sketches 242 | with: 243 | github-token: ${{ secrets.GITHUB_TOKEN }} 244 | platforms: ${{ matrix.board.platforms }} 245 | fqbn: ${{ matrix.board.fqbn }} 246 | libraries: ${{ matrix.board.libraries }} 247 | sketch-paths: | 248 | - examples/Sweep 249 | 250 | python-package-dependency: 251 | needs: run-determination 252 | if: needs.run-determination.outputs.result == 'true' 253 | runs-on: ubuntu-latest 254 | 255 | steps: 256 | - name: Checkout local repo 257 | uses: actions/checkout@v6 258 | 259 | - name: Install Python package dependency 260 | run: | 261 | pip install \ 262 | --ignore-installed \ 263 | --user \ 264 | cowsay 265 | 266 | - name: Run action with board that has external Python package dependency 267 | # Use action from local path 268 | uses: ./ 269 | with: 270 | github-token: ${{ secrets.GITHUB_TOKEN }} 271 | platforms: | 272 | - name: arduino:avr 273 | - source-path: ${{ env.TESTDATA_PLATFORMS_PATH }}/PythonPackageDependent 274 | name: PythonPackageDependent:avr 275 | fqbn: PythonPackageDependent:avr:package_dependent 276 | libraries: | 277 | [] 278 | sketch-paths: | 279 | - ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum 280 | 281 | # Targeted testing for ESP32 boards platform support. 282 | pyserial-dependency: 283 | needs: run-determination 284 | if: needs.run-determination.outputs.result == 'true' 285 | runs-on: ubuntu-latest 286 | 287 | steps: 288 | - name: Checkout local repo 289 | uses: actions/checkout@v6 290 | 291 | - name: Install pyserial 292 | run: | 293 | # Use of pip3 and omission of recommended flags done to reproduce established use pattern: 294 | # https://github.com/arduino-libraries/ArduinoIoTCloud/blob/1.11.0/.github/workflows/compile-examples.yml#L206 295 | pip3 install pyserial 296 | 297 | - name: Run action with board that has pyserial dependency 298 | # Use action from local path 299 | uses: ./ 300 | with: 301 | github-token: ${{ secrets.GITHUB_TOKEN }} 302 | platforms: | 303 | - name: arduino:avr 304 | - source-path: ${{ env.TESTDATA_PLATFORMS_PATH }}/PyserialDependent 305 | name: PyserialDependent:avr 306 | fqbn: PyserialDependent:avr:pyserial_dependent 307 | libraries: | 308 | [] 309 | sketch-paths: | 310 | - ${{ env.TESTDATA_SKETCHES_PATH }}/BareMinimum 311 | 312 | check-sketches-reports: 313 | needs: 314 | - run-determination 315 | - all-inputs 316 | if: needs.run-determination.outputs.result == 'true' 317 | runs-on: ubuntu-latest 318 | 319 | steps: 320 | # Checkout is needed to get the golden reports 321 | - name: Checkout local repo 322 | uses: actions/checkout@v6 323 | 324 | - name: Download sketches reports artifact 325 | uses: actions/download-artifact@v7 326 | with: 327 | merge-multiple: true 328 | path: ${{ env.SKETCHES_REPORTS_PATH }} 329 | pattern: ${{ needs.all-inputs.outputs.report-artifact-prefix }}* 330 | 331 | - name: Compare generated sketches report to golden report 332 | run: | 333 | # The commit hash changes on every push, so it can't be compared against the golden report 334 | if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then 335 | COMMIT_HASH="${{ github.event.pull_request.head.sha }}" 336 | else 337 | COMMIT_HASH="$(git rev-parse HEAD)" 338 | fi 339 | 340 | set +o errexit # Unset errexit so the results of all report comparisons are shown before exiting 341 | EXIT_STATUS=0 342 | while read -r reportPath; do 343 | echo "Sketches report $reportPath matches expected:" 344 | 345 | ( 346 | # Check static report components against golden reports 347 | jq \ 348 | --null-input \ 349 | --exit-status \ 350 | --slurpfile \ 351 | generated \ 352 | "$reportPath" \ 353 | --slurpfile \ 354 | golden \ 355 | "${{ env.TESTDATA_REPORTS_PATH }}/${{ needs.all-inputs.outputs.report-artifact-prefix }}/$(basename "$reportPath")" \ 356 | '($generated|.[0].boards) == ($golden|.[0].boards)' 357 | ) && ( 358 | # Check the commit_hash value 359 | jq \ 360 | --null-input \ 361 | --exit-status \ 362 | --slurpfile generated "$reportPath" \ 363 | --arg commit_hash "$COMMIT_HASH" \ 364 | '$generated|.[0].commit_hash == $commit_hash|.' 365 | ) && ( 366 | # Check the commit_url value 367 | jq \ 368 | --null-input \ 369 | --exit-status \ 370 | --slurpfile generated "$reportPath" \ 371 | --arg commit_url "${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${COMMIT_HASH}" \ 372 | '$generated|.[0].commit_url == $commit_url|.' 373 | ) 374 | 375 | if [[ $? -ne 0 ]]; then 376 | echo "::error::Sketches report $reportPath mismatch." 377 | EXIT_STATUS=1 378 | fi 379 | done <<<"$(find "${{ env.SKETCHES_REPORTS_PATH }}" -type f -and -name '*.json')" 380 | 381 | exit $EXIT_STATUS 382 | 383 | expected-failed-compilation: 384 | needs: run-determination 385 | if: needs.run-determination.outputs.result == 'true' 386 | runs-on: ubuntu-latest 387 | 388 | steps: 389 | - name: Checkout local repo 390 | uses: actions/checkout@v6 391 | 392 | - name: Compile sketch that is expected to error 393 | id: compile-sketches 394 | continue-on-error: true 395 | uses: ./ 396 | with: 397 | fqbn: arduino:avr:uno 398 | github-token: ${{ secrets.GITHUB_TOKEN }} 399 | libraries: | 400 | [] 401 | sketch-paths: | 402 | - ${{ env.TESTDATA_SKETCHES_PATH }}/Error 403 | 404 | - name: Fail the job if the action run succeeded 405 | if: steps.compile-sketches.outcome == 'success' 406 | run: | 407 | echo "::error::The action run was expected to fail, but passed!" 408 | exit 1 409 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `arduino/compile-sketches` action 2 | 3 | [![Check Action Metadata status](https://github.com/arduino/compile-sketches/actions/workflows/check-action-metadata-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-action-metadata-task.yml) 4 | [![Check Files status](https://github.com/arduino/compile-sketches/actions/workflows/check-files-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-files-task.yml) 5 | [![Check General Formatting status](https://github.com/arduino/compile-sketches/actions/workflows/check-general-formatting-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-general-formatting-task.yml) 6 | [![Check License status](https://github.com/arduino/compile-sketches/actions/workflows/check-license.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-license.yml) 7 | [![Check Markdown status](https://github.com/arduino/compile-sketches/actions/workflows/check-markdown-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-markdown-task.yml) 8 | [![Check npm status](https://github.com/arduino/compile-sketches/actions/workflows/check-npm-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-npm-task.yml) 9 | [![Check Poetry status](https://github.com/arduino/compile-sketches/actions/workflows/check-poetry-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-poetry-task.yml) 10 | [![Check Prettier Formatting status](https://github.com/arduino/compile-sketches/actions/workflows/check-prettier-formatting-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-prettier-formatting-task.yml) 11 | [![Check Python status](https://github.com/arduino/compile-sketches/actions/workflows/check-python-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-python-task.yml) 12 | [![Check Taskfiles status](https://github.com/arduino/compile-sketches/actions/workflows/check-taskfiles.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-taskfiles.yml) 13 | [![Check ToC status](https://github.com/arduino/compile-sketches/actions/workflows/check-toc-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-toc-task.yml) 14 | [![Check Workflows status](https://github.com/arduino/compile-sketches/actions/workflows/check-workflows-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-workflows-task.yml) 15 | [![Check YAML status](https://github.com/arduino/compile-sketches/actions/workflows/check-yaml-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/check-yaml-task.yml) 16 | [![Spell Check status](https://github.com/arduino/compile-sketches/actions/workflows/spell-check-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/spell-check-task.yml) 17 | [![Sync Labels status](https://github.com/arduino/compile-sketches/actions/workflows/sync-labels-npm.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/sync-labels-npm.yml) 18 | [![Test Python status](https://github.com/arduino/compile-sketches/actions/workflows/test-python-poetry-task.yml/badge.svg)](https://github.com/arduino/compile-sketches/actions/workflows/test-python-poetry-task.yml) 19 | [![codecov](https://codecov.io/gh/arduino/compile-sketches/branch/main/graph/badge.svg?token=Uv6f1ebMZ4)](https://codecov.io/gh/arduino/compile-sketches) 20 | 21 | This action checks whether [Arduino](https://www.arduino.cc/) sketches compile and produces a report of data from the compilations. 22 | 23 | ## Table of contents 24 | 25 | 26 | 27 | - [Inputs](#inputs) 28 | - [`cli-version`](#cli-version) 29 | - [`fqbn`](#fqbn) 30 | - [`platforms`](#platforms) 31 | - [Supported platform sources:](#supported-platform-sources) 32 | - [Boards Manager](#boards-manager) 33 | - [Local path](#local-path) 34 | - [Repository](#repository) 35 | - [Archive download](#archive-download) 36 | - [`libraries`](#libraries) 37 | - [Supported library sources:](#supported-library-sources) 38 | - [Library Manager](#library-manager) 39 | - [Local path](#local-path-1) 40 | - [Repository](#repository-1) 41 | - [Archive download](#archive-download-1) 42 | - [`sketch-paths`](#sketch-paths) 43 | - [`cli-compile-flags`](#cli-compile-flags) 44 | - [`verbose`](#verbose) 45 | - [`sketches-report-path`](#sketches-report-path) 46 | - [`github-token`](#github-token) 47 | - [`enable-deltas-report`](#enable-deltas-report) 48 | - [How it works](#how-it-works) 49 | - [`enable-warnings-report`](#enable-warnings-report) 50 | - [Example usage](#example-usage) 51 | - [Additional resources](#additional-resources) 52 | 53 | 54 | 55 | ## Inputs 56 | 57 | ### `cli-version` 58 | 59 | The version of [Arduino CLI](https://github.com/arduino/arduino-cli) to use. 60 | 61 | **Default**: `"latest"` 62 | 63 | ### `fqbn` 64 | 65 | The fully qualified board name to use when compiling. 66 | 67 | **Default**: `"arduino:avr:uno"` 68 | 69 | If the board is from one of the platforms provided by Arduino's [default package index](https://downloads.arduino.cc/packages/package_index.json), the board's platform dependency will be automatically detected and the latest version installed. For boards of platforms not in the default package index, previous versions, or other platform sources, the platform dependency must be defined via the [`platforms` input](#platforms). 70 | 71 | ### `platforms` 72 | 73 | [YAML](https://en.wikipedia.org/wiki/YAML)-format list of platform dependencies to install. 74 | 75 | **Default**: The board's dependency will be automatically determined from the `fqbn` input and the latest version of that platform will be installed via Boards Manager. 76 | 77 | If a platform dependency from a non-Boards Manager source of the same name as another Boards Manager source platform dependency is defined, they will both be installed, with the non-Boards Manager dependency overwriting the Boards Manager platform installation. This permits testing against a non-release version of a platform while using Boards Manager to install the platform's tools dependencies. 78 | Example: 79 | 80 | ```yaml 81 | platforms: | 82 | # Install the latest release of Arduino SAMD Boards and its toolchain via Boards Manager 83 | - name: "arduino:samd" 84 | # Install the platform from the root of the repository, replacing the BM installed platform 85 | - source-path: "." 86 | name: "arduino:samd" 87 | ``` 88 | 89 | #### Supported platform sources: 90 | 91 | ##### Boards Manager 92 | 93 | Keys: 94 | 95 | - **`name`** - (**required**) platform name in the form of `VENDOR:ARCHITECTURE` (e.g., `arduino:avr`). 96 | - **`version`** - version of the platform to install. 97 | - **Default**: the latest version. 98 | - **`source-url`** - Boards Manager URL of the platform. 99 | - **Default**: Arduino's package index, which allows installation of all official platforms. 100 | 101 | ##### Local path 102 | 103 | Keys: 104 | 105 | - **`source-path`** - (**required**) path to install as a platform. Relative paths are assumed to be relative to the root of the repository. 106 | - **`name`** - (**required**) platform name in the form of `VENDOR:ARCHITECTURE` (e.g., `arduino:avr`). 107 | 108 | ##### Repository 109 | 110 | Keys: 111 | 112 | - **`source-url`** - (**required**) URL to clone the repository from. It must start with `git://` or end with `.git`. 113 | - **`name`** - (**required**) platform name in the form of `VENDOR:ARCHITECTURE` (e.g., `arduino:avr`). 114 | - **`version`** - [Git ref](https://git-scm.com/book/en/v2/Git-Internals-Git-References) of the repository to checkout. The special version name `latest` will cause the latest tag to be used. 115 | - **Default**: the repository is checked out to the tip of the default branch. 116 | - **`source-path`** - path to install as a platform. Paths are relative to the root of the repository. 117 | - **Default**: root of the repository. 118 | 119 | ##### Archive download 120 | 121 | Keys: 122 | 123 | - **`source-url`** - (**required**) download URL for the archive (e.g., `https://github.com/arduino/ArduinoCore-avr/archive/master.zip`). 124 | - **`name`** - (**required**) platform name in the form of `VENDOR:ARCHITECTURE` (e.g., `arduino:avr`). 125 | - **`source-path`** - path to install as a platform. Paths are relative to the root folder of the archive, or the root of the archive if it has no root folder. 126 | - **Default**: root folder of the archive. 127 | 128 | ### `libraries` 129 | 130 | [YAML](https://en.wikipedia.org/wiki/YAML)-format list of library dependencies to install. 131 | 132 | **Default**: `"- source-path: ./"` 133 | This causes the repository to be installed as a library. If there are no library dependencies and you want to override the default, set the `libraries` input to an empty list (`- libraries: '[]'`). 134 | 135 | Libraries are installed under the Arduino user folder at `~/Arduino/libraries`. 136 | 137 | **Note**: when the deprecated space-separated list format of this input is used, the repository under test will always be installed as a library. 138 | 139 | #### Supported library sources: 140 | 141 | ##### Library Manager 142 | 143 | Keys: 144 | 145 | - **`name`** - (**required**) name of the library, as defined in the `name` field of its [library.properties](https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format) metadata file. 146 | - **`version`** - version of the library to install. 147 | - **Default**: the latest version. 148 | 149 | **Notes**: 150 | 151 | - The library will be installed to a folder matching its name, but with any spaces replaced by `_`. 152 | - If the library's author defined dependencies, those libraries will be installed automatically. 153 | 154 | ##### Local path 155 | 156 | Keys: 157 | 158 | - **`source-path`** - (**required**) path to install as a library. Relative paths are assumed to be relative to the root of the repository. 159 | - **`destination-name`** - folder name to install the library to. 160 | - **Default**: the folder will be named according to the source repository or subfolder name. 161 | 162 | ##### Repository 163 | 164 | Keys: 165 | 166 | - **`source-url`** - (**required**) URL to clone the repository from. It must start with `git://` or end with `.git`. 167 | - **`version`** - [Git ref](https://git-scm.com/book/en/v2/Git-Internals-Git-References) of the repository to checkout. The special version name `latest` will cause the latest tag to be used. 168 | - **Default**: the tip of the default branch. 169 | - **`source-path`** - path to install as a library. Paths are relative to the root of the repository. 170 | - **Default**: root of the repository. 171 | - **`destination-name`** - folder name to install the library to. 172 | - **Default**: named according to the source repository or subfolder name. 173 | 174 | ##### Archive download 175 | 176 | Keys: 177 | 178 | - **`source-url`** - (**required**) download URL for the archive (e.g., `https://github.com/arduino-libraries/Servo/archive/master.zip`). 179 | - **`source-path`** - path to install as a library. Paths are relative to the root folder of the archive, or the root of the archive if it has no root folder. 180 | - **Default**: root folder of the archive. 181 | - **`destination-name`** - folder name to install the library to. 182 | - **Default**: named according to the source archive or subfolder name. 183 | 184 | ### `sketch-paths` 185 | 186 | [YAML](https://en.wikipedia.org/wiki/YAML)-format list of paths containing sketches to compile. These paths will be searched recursively. 187 | 188 | **Default**: `"- examples"` 189 | 190 | ### `cli-compile-flags` 191 | 192 | YAML-format list of flags to add to the Arduino CLI command used to compile the sketches. For the available flags, see [the Arduino CLI command reference](https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/#options). 193 | 194 | **Default**: `""` 195 | 196 | ### `verbose` 197 | 198 | Set to true to show verbose output in the log. 199 | 200 | **Default**: `false` 201 | 202 | ### `sketches-report-path` 203 | 204 | Path in which to save a JSON formatted file containing data from the sketch compilations. Should be used only to store reports. Relative paths are relative to [`GITHUB_WORKSPACE`](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables). The folder will be created if it doesn't already exist. 205 | 206 | This report is used by the [`arduino/report-size-deltas`](https://github.com/arduino/report-size-deltas) action. 207 | 208 | **Default**: `"sketches-reports"` 209 | 210 | ### `github-token` 211 | 212 | GitHub access token used to get information from the GitHub API. Only needed for private repositories with [`enable-deltas-report`](#enable-deltas-report) set to `true`. It will be convenient to use [`${{ secrets.GITHUB_TOKEN }}`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token). 213 | 214 | **Default**: `""` 215 | 216 | ### `enable-deltas-report` 217 | 218 | Set to `true` to cause the action to determine the change in memory usage and compiler warnings of the compiled sketches. 219 | 220 | If the workflow is triggered by a [`pull_request` event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request), the comparison is between the pull request branch and the tip of the pull request's base branch. 221 | 222 | If the workflow is triggered by a [`push` event](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#push), the comparison is between the pushed commit and its immediate parent. 223 | 224 | The deltas will be displayed in the GitHub Actions build log. 225 | 226 | This report may be used with the [`arduino/report-size-deltas` action](https://github.com/arduino/report-size-deltas). 227 | 228 | **Default**: `false` 229 | 230 | #### How it works 231 | 232 | The sketch is first compiled with the repository in [`$GITHUB_WORKSPACE`](https://docs.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables) at the state it was at before the action's step. Data from the compilation is recorded in the sketches report. Next, a [`git checkout`] to the [Git ref](https://git-scm.com/book/en/v2/Git-Internals-Git-References) used as the base of the comparison is done and the compilation + data recording process repeated. The delta is the change in the data between the two compilations. 233 | 234 | Dependencies defined via the [`libraries`](#libraries) or [`platforms`](#platforms) inputs are installed via [symlinks](https://en.wikipedia.org/wiki/Symbolic_link), meaning dependencies from local paths under `$GITHUB_WORKSPACE` reflect the deltas checkouts even though they are installed outside `$GITHUB_WORKSPACE`. 235 | 236 | ### `enable-warnings-report` 237 | 238 | Set to `true` to cause the action to record the compiler warning count for each sketch compilation in the sketches report. 239 | 240 | **Default**: `false` 241 | 242 | ## Example usage 243 | 244 | ```yaml 245 | - uses: arduino/compile-sketches@v1 246 | with: 247 | fqbn: "arduino:avr:uno" 248 | libraries: | 249 | - name: Servo 250 | - name: Stepper 251 | version: 1.1.3 252 | ``` 253 | 254 | ## Additional resources 255 | 256 | - [Introductory article about **arduino/compile-sketches**](https://blog.arduino.cc/2021/04/09/test-your-arduino-projects-with-github-actions/) 257 | - [Frequently asked questions about **arduino/compile-sketches**](docs/FAQ.md#frequently-asked-questions) 258 | - [**GitHub Actions** documentation](https://docs.github.com/actions/learn-github-actions/understanding-github-actions) 259 | - [Discuss or request assistance on **Arduino Forum**](https://forum.arduino.cc/) 260 | -------------------------------------------------------------------------------- /Taskfile.yml: -------------------------------------------------------------------------------- 1 | # See: https://taskfile.dev/#/usage 2 | version: "3" 3 | 4 | vars: 5 | PYTHON_PROJECT_PATH: compilesketches 6 | # Last version of ajv-cli with support for the JSON schema "Draft 4" specification 7 | SCHEMA_DRAFT_4_AJV_CLI_VERSION: 3.3.0 8 | 9 | tasks: 10 | check: 11 | desc: Check for problems with the project 12 | deps: 13 | - task: action:validate 14 | - task: ci:validate 15 | - task: general:check-formatting 16 | - task: general:check-spelling 17 | - task: markdown:check-links 18 | - task: markdown:lint 19 | - task: npm:validate 20 | - task: python:lint 21 | - task: python:test 22 | - task: yaml:lint 23 | 24 | fix: 25 | desc: Make automated corrections to the project's files 26 | deps: 27 | - task: general:correct-spelling 28 | - task: general:format-prettier 29 | - task: markdown:fix 30 | - task: markdown:toc 31 | vars: 32 | FILE_PATH: README.md 33 | MAX_DEPTH: 5 34 | - task: python:format 35 | 36 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-action-metadata-task/Taskfile.yml 37 | action:validate: 38 | desc: Validate GitHub Actions metadata against JSON schema 39 | vars: 40 | ACTION_METADATA_SCHEMA_PATH: 41 | sh: task utility:mktemp-file TEMPLATE="github-action-schema-XXXXXXXXXX.json" 42 | deps: 43 | - task: npm:install-deps 44 | cmds: 45 | - | 46 | wget \ 47 | --quiet \ 48 | --output-document="{{.ACTION_METADATA_SCHEMA_PATH}}" \ 49 | https://json.schemastore.org/github-action 50 | - | 51 | npx \ 52 | ajv-cli \ 53 | validate \ 54 | --strict=false \ 55 | -s "{{.ACTION_METADATA_SCHEMA_PATH}}" \ 56 | -d "action.yml" 57 | 58 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-workflows-task/Taskfile.yml 59 | ci:validate: 60 | desc: Validate GitHub Actions workflows against their JSON schema 61 | vars: 62 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json 63 | WORKFLOW_SCHEMA_URL: https://json.schemastore.org/github-workflow 64 | WORKFLOW_SCHEMA_PATH: 65 | sh: task utility:mktemp-file TEMPLATE="workflow-schema-XXXXXXXXXX.json" 66 | WORKFLOWS_DATA_PATH: "./.github/workflows/*.{yml,yaml}" 67 | deps: 68 | - task: npm:install-deps 69 | cmds: 70 | - | 71 | wget \ 72 | --quiet \ 73 | --output-document="{{.WORKFLOW_SCHEMA_PATH}}" \ 74 | {{.WORKFLOW_SCHEMA_URL}} 75 | - | 76 | npx \ 77 | --package=ajv-cli \ 78 | --package=ajv-formats \ 79 | ajv validate \ 80 | --all-errors \ 81 | --strict=false \ 82 | -c ajv-formats \ 83 | -s "{{.WORKFLOW_SCHEMA_PATH}}" \ 84 | -d "{{.WORKFLOWS_DATA_PATH}}" 85 | 86 | docs:generate: 87 | desc: Create all generated documentation content 88 | # This is an "umbrella" task used to call any documentation generation processes the project has. 89 | # It can be left empty if there are none. 90 | 91 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml 92 | general:check-filenames: 93 | desc: Check for non-portable filenames 94 | cmds: 95 | - | 96 | find . \ 97 | -type d -name '.git' -prune -o \ 98 | -type d -name '.licenses' -prune -o \ 99 | -type d -name '__pycache__' -prune -o \ 100 | -type d -name 'node_modules' -prune -o \ 101 | -exec \ 102 | sh \ 103 | -c \ 104 | ' \ 105 | basename "$0" | \ 106 | grep \ 107 | --extended-regexp \ 108 | --regexp='"'"'([<>:"/\\|?*'"'"'"$(printf "\001-\037")"'"'"'])|(.+\.$)'"'"' \ 109 | --silent \ 110 | && \ 111 | echo "$0" 112 | ' \ 113 | '{}' \ 114 | \; \ 115 | -execdir \ 116 | false \ 117 | '{}' \ 118 | + \ 119 | || \ 120 | { 121 | echo 122 | echo "Prohibited characters found in filenames" 123 | echo "See:" 124 | echo "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=except%20for%20the%20following" 125 | false 126 | } 127 | - | 128 | find . \ 129 | -type d -name '.git' -prune -o \ 130 | -type d -name '.licenses' -prune -o \ 131 | -type d -name '__pycache__' -prune -o \ 132 | -type d -name 'node_modules' -prune -o \ 133 | -exec \ 134 | sh \ 135 | -c \ 136 | ' \ 137 | basename "$0" | \ 138 | grep \ 139 | --ignore-case \ 140 | --extended-regexp \ 141 | --regexp='"'"'^(con|prn|aux|nul|com[0-9]+|lpt[0-9]+)$'"'"' \ 142 | --silent \ 143 | && \ 144 | echo "$0" 145 | ' \ 146 | '{}' \ 147 | \; \ 148 | -execdir \ 149 | false \ 150 | '{}' \ 151 | + \ 152 | || \ 153 | { 154 | echo 155 | echo "Reserved filenames found" 156 | echo "See:" 157 | echo "https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions:~:text=use%20the%20following-,reserved%20names,-for%20the%20name" 158 | false 159 | } 160 | 161 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-general-formatting-task/Taskfile.yml 162 | general:check-formatting: 163 | desc: Check basic formatting style of all files 164 | cmds: 165 | - | 166 | if ! which ec &>/dev/null; then 167 | echo "ec not found or not in PATH." 168 | echo "Please install: https://github.com/editorconfig-checker/editorconfig-checker#installation" 169 | exit 1 170 | fi 171 | - ec 172 | 173 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml 174 | general:check-spelling: 175 | desc: Check for commonly misspelled words 176 | deps: 177 | - task: poetry:install-deps 178 | vars: 179 | POETRY_GROUPS: dev 180 | cmds: 181 | - poetry run codespell 182 | 183 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-files-task/Taskfile.yml 184 | general:check-symlinks: 185 | desc: Check for bad symlinks 186 | cmds: 187 | - | 188 | find . \ 189 | -type d -name '.git' -prune -o \ 190 | -type d -name '.licenses' -prune -o \ 191 | -type d -name '__pycache__' -prune -o \ 192 | -type d -name 'node_modules' -prune -o \ 193 | -type l \ 194 | -execdir \ 195 | test ! -e '{}' \ 196 | \; \ 197 | -exec \ 198 | echo '{}' \ 199 | \; \ 200 | -execdir \ 201 | false \ 202 | '{}' \ 203 | + \ 204 | || \ 205 | { 206 | echo 'Broken or circular symlink found' 207 | false 208 | } 209 | 210 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check-task/Taskfile.yml 211 | general:correct-spelling: 212 | desc: Correct commonly misspelled words where possible 213 | deps: 214 | - task: poetry:install-deps 215 | vars: 216 | POETRY_GROUPS: dev 217 | cmds: 218 | - poetry run codespell --write-changes 219 | 220 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml 221 | general:format-prettier: 222 | desc: Format all supported files with Prettier 223 | deps: 224 | - task: npm:install-deps 225 | cmds: 226 | - npx prettier --write . 227 | 228 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml 229 | markdown:check-links: 230 | desc: Check for broken links 231 | vars: 232 | # The command is defined in a Taskfile variable to allow it to be broken into multiple lines for readability. 233 | # This can't be done in the `cmd` object of the Taskfile because `npx --call` uses the native shell, which causes 234 | # standard newline escaping syntax to not work when the task is run on Windows. 235 | # 236 | # Using -regex instead of -name to avoid Task's behavior of globbing even when quoted on Windows 237 | # The odd method for escaping . in the regex is required for windows compatibility because mvdan.cc/sh gives 238 | # \ characters special treatment on Windows in an attempt to support them as path separators. 239 | # 240 | # prettier-ignore 241 | CHECK_LINKS_COMMAND: 242 | " 243 | find . \ 244 | -type d -name \".git\" -prune -o \ 245 | -type d -name \".licenses\" -prune -o \ 246 | -type d -name \"__pycache__\" -prune -o \ 247 | -type d -name \"node_modules\" -prune -o \ 248 | -regex \".*[.]md\" \ 249 | -exec \ 250 | markdown-link-check \ 251 | --quiet \ 252 | --config \"./.markdown-link-check.json\" \ 253 | \\{\\} \ 254 | + 255 | " 256 | deps: 257 | - task: docs:generate 258 | - task: npm:install-deps 259 | cmds: 260 | - | 261 | npx \ 262 | --package=markdown-link-check \ 263 | --call='{{.CHECK_LINKS_COMMAND}}' 264 | 265 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml 266 | markdown:fix: 267 | desc: Automatically correct linting violations in Markdown files where possible 268 | deps: 269 | - task: npm:install-deps 270 | cmds: 271 | - npx markdownlint-cli --fix "**/*.md" 272 | 273 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml 274 | markdown:lint: 275 | desc: Check for problems in Markdown files 276 | deps: 277 | - task: npm:install-deps 278 | cmds: 279 | - npx markdownlint-cli "**/*.md" 280 | 281 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-toc-task/Taskfile.yml 282 | markdown:toc: 283 | desc: Update the table of contents 284 | deps: 285 | - task: npm:install-deps 286 | cmds: 287 | - | 288 | npx markdown-toc \ 289 | --bullets=- \ 290 | --maxdepth={{.MAX_DEPTH}} \ 291 | -i \ 292 | "{{.FILE_PATH}}" 293 | 294 | # Parameter variables: 295 | # - PROJECT_PATH: path of the npm-managed project. Default value: "./" 296 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/npm-task/Taskfile.yml 297 | npm:install-deps: 298 | desc: Install dependencies managed by npm 299 | run: once 300 | dir: | 301 | "{{default "./" .PROJECT_PATH}}" 302 | cmds: 303 | - npm install 304 | 305 | # Parameter variables: 306 | # - PROJECT_PATH: path of the npm-managed project. Default value: "./" 307 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-npm-task/Taskfile.yml 308 | npm:validate: 309 | desc: Validate npm configuration files against their JSON schema 310 | vars: 311 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/package.json 312 | SCHEMA_URL: https://json.schemastore.org/package.json 313 | SCHEMA_PATH: 314 | sh: task utility:mktemp-file TEMPLATE="package-json-schema-XXXXXXXXXX.json" 315 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/ava.json 316 | AVA_SCHEMA_URL: https://json.schemastore.org/ava.json 317 | AVA_SCHEMA_PATH: 318 | sh: task utility:mktemp-file TEMPLATE="ava-schema-XXXXXXXXXX.json" 319 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/base.json 320 | BASE_SCHEMA_URL: https://json.schemastore.org/base.json 321 | BASE_SCHEMA_PATH: 322 | sh: task utility:mktemp-file TEMPLATE="base-schema-XXXXXXXXXX.json" 323 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/eslintrc.json 324 | ESLINTRC_SCHEMA_URL: https://json.schemastore.org/eslintrc.json 325 | ESLINTRC_SCHEMA_PATH: 326 | sh: task utility:mktemp-file TEMPLATE="eslintrc-schema-XXXXXXXXXX.json" 327 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/jscpd.json 328 | JSCPD_SCHEMA_URL: https://json.schemastore.org/jscpd.json 329 | JSCPD_SCHEMA_PATH: 330 | sh: task utility:mktemp-file TEMPLATE="jscpd-schema-XXXXXXXXXX.json" 331 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/npm-badges.json 332 | NPM_BADGES_SCHEMA_URL: https://json.schemastore.org/npm-badges.json 333 | NPM_BADGES_SCHEMA_PATH: 334 | sh: task utility:mktemp-file TEMPLATE="npm-badges-schema-XXXXXXXXXX.json" 335 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/partial-eslint-plugins.json 336 | PARTIAL_ESLINT_PLUGINS_SCHEMA_URL: https://json.schemastore.org/partial-eslint-plugins.json 337 | PARTIAL_ESLINT_PLUGINS_PATH: 338 | sh: task utility:mktemp-file TEMPLATE="partial-eslint-plugins-schema-XXXXXXXXXX.json" 339 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/prettierrc.json 340 | PRETTIERRC_SCHEMA_URL: https://json.schemastore.org/prettierrc.json 341 | PRETTIERRC_SCHEMA_PATH: 342 | sh: task utility:mktemp-file TEMPLATE="prettierrc-schema-XXXXXXXXXX.json" 343 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/semantic-release.json 344 | SEMANTIC_RELEASE_SCHEMA_URL: https://json.schemastore.org/semantic-release.json 345 | SEMANTIC_RELEASE_SCHEMA_PATH: 346 | sh: task utility:mktemp-file TEMPLATE="semantic-release-schema-XXXXXXXXXX.json" 347 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/stylelintrc.json 348 | STYLELINTRC_SCHEMA_URL: https://json.schemastore.org/stylelintrc.json 349 | STYLELINTRC_SCHEMA_PATH: 350 | sh: task utility:mktemp-file TEMPLATE="stylelintrc-schema-XXXXXXXXXX.json" 351 | INSTANCE_PATH: >- 352 | {{default "." .PROJECT_PATH}}/package.json 353 | PROJECT_FOLDER: 354 | sh: pwd 355 | WORKING_FOLDER: 356 | sh: task utility:mktemp-folder TEMPLATE="dependabot-validate-XXXXXXXXXX" 357 | cmds: 358 | - wget --quiet --output-document="{{.SCHEMA_PATH}}" {{.SCHEMA_URL}} 359 | - wget --quiet --output-document="{{.AVA_SCHEMA_PATH}}" {{.AVA_SCHEMA_URL}} 360 | - wget --quiet --output-document="{{.BASE_SCHEMA_PATH}}" {{.BASE_SCHEMA_URL}} 361 | - wget --quiet --output-document="{{.ESLINTRC_SCHEMA_PATH}}" {{.ESLINTRC_SCHEMA_URL}} 362 | - wget --quiet --output-document="{{.JSCPD_SCHEMA_PATH}}" {{.JSCPD_SCHEMA_URL}} 363 | - wget --quiet --output-document="{{.NPM_BADGES_SCHEMA_PATH}}" {{.NPM_BADGES_SCHEMA_URL}} 364 | - wget --quiet --output-document="{{.PARTIAL_ESLINT_PLUGINS_PATH}}" {{.PARTIAL_ESLINT_PLUGINS_SCHEMA_URL}} 365 | - wget --quiet --output-document="{{.PRETTIERRC_SCHEMA_PATH}}" {{.PRETTIERRC_SCHEMA_URL}} 366 | - wget --quiet --output-document="{{.SEMANTIC_RELEASE_SCHEMA_PATH}}" {{.SEMANTIC_RELEASE_SCHEMA_URL}} 367 | - wget --quiet --output-document="{{.STYLELINTRC_SCHEMA_PATH}}" {{.STYLELINTRC_SCHEMA_URL}} 368 | - | 369 | cd "{{.WORKING_FOLDER}}" # Workaround for https://github.com/npm/cli/issues/3210 370 | npx ajv-cli@{{.SCHEMA_DRAFT_4_AJV_CLI_VERSION}} validate \ 371 | --all-errors \ 372 | -s "{{.SCHEMA_PATH}}" \ 373 | -r "{{.AVA_SCHEMA_PATH}}" \ 374 | -r "{{.BASE_SCHEMA_PATH}}" \ 375 | -r "{{.ESLINTRC_SCHEMA_PATH}}" \ 376 | -r "{{.JSCPD_SCHEMA_PATH}}" \ 377 | -r "{{.NPM_BADGES_SCHEMA_PATH}}" \ 378 | -r "{{.PARTIAL_ESLINT_PLUGINS_PATH}}" \ 379 | -r "{{.PRETTIERRC_SCHEMA_PATH}}" \ 380 | -r "{{.SEMANTIC_RELEASE_SCHEMA_PATH}}" \ 381 | -r "{{.STYLELINTRC_SCHEMA_PATH}}" \ 382 | -d "{{.PROJECT_FOLDER}}/{{.INSTANCE_PATH}}" 383 | 384 | poetry:install: 385 | desc: Install Poetry 386 | run: once 387 | cmds: 388 | - | 389 | if ! which pipx &>/dev/null; then 390 | echo "pipx not found or not in PATH." 391 | echo "Please install: https://pipx.pypa.io/stable/installation/#installing-pipx" 392 | exit 1 393 | fi 394 | - | 395 | if ! which yq &>/dev/null; then 396 | echo "yq not found or not in PATH." 397 | echo "Please install: https://github.com/mikefarah/yq/#install" 398 | exit 1 399 | fi 400 | - | 401 | export PIPX_DEFAULT_PYTHON="$( \ 402 | task utility:normalize-path \ 403 | RAW_PATH="$(which python)" \ 404 | )" 405 | pipx install \ 406 | --force \ 407 | "poetry==$( \ 408 | yq \ 409 | --input-format toml \ 410 | --output-format yaml \ 411 | '.tool.poetry.group.pipx.dependencies.poetry' \ 412 | < pyproject.toml 413 | )" 414 | 415 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml 416 | poetry:install-deps: 417 | desc: Install dependencies managed by Poetry 418 | run: when_changed 419 | deps: 420 | - task: poetry:install 421 | cmds: 422 | - | 423 | poetry install \ 424 | {{if .POETRY_GROUPS}} --only {{.POETRY_GROUPS}} {{end}} 425 | 426 | poetry:sync: 427 | desc: Sync poetry.lock 428 | deps: 429 | - task: poetry:install 430 | cmds: 431 | - | 432 | poetry lock \ 433 | --no-cache 434 | 435 | poetry:validate: 436 | desc: Validate pyproject.toml 437 | deps: 438 | - task: poetry:install 439 | cmds: 440 | - | 441 | poetry check \ 442 | --lock 443 | 444 | python:coverage-report: 445 | desc: Show code coverage report 446 | deps: 447 | - task: poetry:install-deps 448 | vars: 449 | POETRY_GROUPS: dev 450 | cmds: 451 | - | 452 | poetry run \ 453 | coverage report 454 | 455 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml 456 | python:format: 457 | desc: Format Python files 458 | deps: 459 | - task: poetry:install-deps 460 | vars: 461 | POETRY_GROUPS: dev 462 | cmds: 463 | - poetry run black . 464 | 465 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-python-task/Taskfile.yml 466 | python:lint: 467 | desc: Lint Python code 468 | deps: 469 | - task: poetry:install-deps 470 | vars: 471 | POETRY_GROUPS: dev 472 | cmds: 473 | - poetry run flake8 --show-source 474 | 475 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-python-poetry-task/Taskfile.yml 476 | python:test: 477 | desc: Run Python tests 478 | deps: 479 | - task: poetry:install-deps 480 | vars: 481 | POETRY_GROUPS: dev,main 482 | cmds: 483 | - | 484 | poetry run \ 485 | coverage run \ 486 | --source="{{.PYTHON_PROJECT_PATH}}" \ 487 | --module \ 488 | pytest "{{.PYTHON_PROJECT_PATH}}/tests" 489 | - | 490 | poetry run \ 491 | coverage xml 492 | 493 | # Make a temporary file named according to the passed TEMPLATE variable and print the path passed to stdout 494 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml 495 | utility:mktemp-file: 496 | vars: 497 | RAW_PATH: 498 | sh: mktemp --tmpdir "{{.TEMPLATE}}" 499 | cmds: 500 | - task: utility:normalize-path 501 | vars: 502 | RAW_PATH: "{{.RAW_PATH}}" 503 | 504 | # Make a temporary folder named according to the passed TEMPLATE variable and print the path passed to stdout 505 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml 506 | utility:mktemp-folder: 507 | vars: 508 | RAW_PATH: 509 | sh: mktemp --directory --tmpdir "{{.TEMPLATE}}" 510 | cmds: 511 | - task: utility:normalize-path 512 | vars: 513 | RAW_PATH: "{{.RAW_PATH}}" 514 | 515 | # Print a normalized version of the path passed via the RAW_PATH variable to stdout 516 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/windows-task/Taskfile.yml 517 | utility:normalize-path: 518 | cmds: 519 | - | 520 | if [[ "{{.OS}}" == "Windows_NT" ]] && which cygpath &>/dev/null; then 521 | # Even though the shell handles POSIX format absolute paths as expected, external applications do not. 522 | # So paths passed to such applications must first be converted to Windows format. 523 | cygpath -w "{{.RAW_PATH}}" 524 | else 525 | echo "{{.RAW_PATH}}" 526 | fi 527 | 528 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-yaml-task/Taskfile.yml 529 | yaml:lint: 530 | desc: Check for problems with YAML files 531 | deps: 532 | - task: poetry:install-deps 533 | vars: 534 | POETRY_GROUPS: dev 535 | cmds: 536 | - poetry run yamllint --format {{default "colored" .YAMLLINT_FORMAT}} . 537 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_warning_count_from_output/has-warnings.txt: -------------------------------------------------------------------------------- 1 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/PropertyContainer.h:25:0, 2 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBORDecoder.h:29, 3 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:32, 4 | from /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:1, 5 | from /github/workspace/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino:14: 6 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h: In member function 'virtual void CloudTelevision::setAttributesFromCloud()': 7 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:229:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 8 | setAttribute((int&)_cloud_value.pbc); 9 | ^ 10 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 11 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 12 | ^ 13 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:230:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 14 | setAttribute((int&)_cloud_value.inp); 15 | ^ 16 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 17 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 18 | ^ 19 | In file included from /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:1:0, 20 | from /github/workspace/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino:14: 21 | /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h: In function 'void initProperties()': 22 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:100:64: warning: 'void ArduinoIoTCloudClass::addPropertyReal(bool&, String, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 23 | #define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__) 24 | ^ 25 | /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:21:16: note: in expansion of macro 'addProperty' 26 | ArduinoCloud.addProperty(switchButton, WRITE, ON_CHANGE, onSwitchButtonChange); 27 | ^~~~~~~~~~~ 28 | In file included from /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:1:0, 29 | from /github/workspace/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino:14: 30 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:107:10: note: declared here 31 | void addPropertyReal(bool& property, String name, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 32 | ^~~~~~~~~~~~~~~ 33 | In file included from /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:1:0, 34 | from /github/workspace/examples/ArduinoIoTCloud-Advanced/ArduinoIoTCloud-Advanced.ino:14: 35 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:100:64: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 36 | #define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__) 37 | ^ 38 | /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:22:16: note: in expansion of macro 'addProperty' 39 | ArduinoCloud.addProperty(location, READ, ON_CHANGE); 40 | ^~~~~~~~~~~ 41 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:106:10: note: declared here 42 | void addPropertyReal(Property& property, String name, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 43 | ^~~~~~~~~~~~~~~ 44 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:100:64: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 45 | #define addProperty( v, ...) addPropertyReal(v, #v, __VA_ARGS__) 46 | ^ 47 | /tmp/arduino-sketch-0CD64181F5310E3579165DCB549C8EEE/sketch/thingProperties.h:23:16: note: in expansion of macro 'addProperty' 48 | ArduinoCloud.addProperty(color, READWRITE, ON_CHANGE, onColorChange); 49 | ^~~~~~~~~~~ 50 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:106:10: note: declared here 51 | void addPropertyReal(Property& property, String name, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 52 | ^~~~~~~~~~~~~~~ 53 | In file included from /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.cpp:22:0: 54 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.h: In constructor 'ConnectionHandler::ConnectionHandler(bool)': 55 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.h:209:28: warning: 'ConnectionHandler::_current_net_connection_state' will be initialized after [-Wreorder] 56 | NetworkConnectionState _current_net_connection_state; 57 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 58 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.h:208:19: warning: 'long unsigned int ConnectionHandler::_lastConnectionTickTime' [-Wreorder] 59 | unsigned long _lastConnectionTickTime; 60 | ^~~~~~~~~~~~~~~~~~~~~~~ 61 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.cpp:28:1: warning: when initialized here [-Wreorder] 62 | ConnectionHandler::ConnectionHandler(bool const keep_alive) 63 | ^~~~~~~~~~~~~~~~~ 64 | In file included from /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.h:22:0, 65 | from /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_WiFiConnectionHandler.h:25, 66 | from /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_WiFiConnectionHandler.cpp:22: 67 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_WiFiConnectionHandler.cpp: In member function 'virtual NetworkConnectionState WiFiConnectionHandler::update_handleInit()': 68 | /github/home/Arduino/libraries/WiFi101/src/WiFi101.h:24:38: warning: comparison with string literal results in unspecified behavior [-Waddress] 69 | #define WIFI_FIRMWARE_LATEST_MODEL_B "19.6.1" 70 | ^ 71 | /github/home/Arduino/libraries/WiFi101/src/WiFi101.h:27:32: note: in expansion of macro 'WIFI_FIRMWARE_LATEST_MODEL_B' 72 | #define WIFI_FIRMWARE_REQUIRED WIFI_FIRMWARE_LATEST_MODEL_B 73 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_ConnectionHandler.h:29:42: note: in expansion of macro 'WIFI_FIRMWARE_REQUIRED' 75 | #define WIFI_FIRMWARE_VERSION_REQUIRED WIFI_FIRMWARE_REQUIRED 76 | ^~~~~~~~~~~~~~~~~~~~~~ 77 | /github/home/Arduino/libraries/Arduino_ConnectionHandler/src/Arduino_WiFiConnectionHandler.cpp:69:32: note: in expansion of macro 'WIFI_FIRMWARE_VERSION_REQUIRED' 78 | if (WiFi.firmwareVersion() < WIFI_FIRMWARE_VERSION_REQUIRED) 79 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 80 | In file included from /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0, 81 | from /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105, 82 | from /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/sam.h:540, 83 | from /github/home/.arduino15/packages/arduino/hardware/samd/1.8.8/cores/arduino/Arduino.h:48, 84 | from /github/home/Arduino/libraries/WiFi101/src/utility/WiFiSocket.h:28, 85 | from /github/home/Arduino/libraries/WiFi101/src/WiFi.cpp:36: 86 | /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined 87 | #define LITTLE_ENDIAN 1 88 | 89 | In file included from /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/sys/types.h:67:0, 90 | from /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/time.h:28, 91 | from /github/home/Arduino/libraries/WiFi101/src/WiFi.cpp:28: 92 | /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/machine/endian.h:17:0: note: this is the location of the previous definition 93 | #define LITTLE_ENDIAN _LITTLE_ENDIAN 94 | 95 | /github/home/Arduino/libraries/WiFi101/src/WiFi.cpp: In member function 'char* WiFiClass::firmwareVersion()': 96 | /github/home/Arduino/libraries/WiFi101/src/WiFi.cpp:343:7: warning: '%d' directive writing between 1 and 3 bytes into a region of size between 1 and 5 [-Wformat-overflow=] 97 | char* WiFiClass::firmwareVersion() 98 | ^~~~~~~~~ 99 | /github/home/Arduino/libraries/WiFi101/src/WiFi.cpp:343:7: note: directive argument in the range [0, 255] 100 | /github/home/Arduino/libraries/WiFi101/src/WiFi.cpp:356:10: note: 'sprintf' output between 6 and 12 bytes into a destination of size 9 101 | sprintf(_version, "%d.%d.%d", rev.u8FirmwareMajor, rev.u8FirmwareMinor, rev.u8FirmwarePatch); 102 | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 103 | /github/home/Arduino/libraries/Arduino_DebugUtils/src/Arduino_DebugUtils.cpp: In member function 'void Arduino_DebugUtils::print(int, const __FlashStringHelper*, ...)': 104 | /github/home/Arduino/libraries/Arduino_DebugUtils/src/Arduino_DebugUtils.cpp:86:3: warning: second parameter of 'va_start' not last named argument [-Wvarargs] 105 | va_start(args, fmt_str.c_str()); 106 | ^~~~~~~~ 107 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/PropertyContainer.h:25:0, 108 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBORDecoder.h:29, 109 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:32, 110 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:22: 111 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h: In member function 'virtual void CloudTelevision::setAttributesFromCloud()': 112 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:229:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 113 | setAttribute((int&)_cloud_value.pbc); 114 | ^ 115 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 116 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 117 | ^ 118 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:230:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 119 | setAttribute((int&)_cloud_value.inp); 120 | ^ 121 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 122 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 123 | ^ 124 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, permissionType, long int, void (*)(), float, void (*)(Property&))': 125 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:52:84: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 126 | addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); 127 | ^ 128 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:22:0: 129 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:124:10: note: declared here 130 | void addPropertyReal(Property& property, String name, int tag, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 131 | ^~~~~~~~~~~~~~~ 132 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(bool&, String, permissionType, long int, void (*)(), float, void (*)(Property&))': 133 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:85:84: warning: 'void ArduinoIoTCloudClass::addPropertyReal(bool&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 134 | addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); 135 | ^ 136 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:22:0: 137 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:125:10: note: declared here 138 | void addPropertyReal(bool& property, String name, int tag, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 139 | ^~~~~~~~~~~~~~~ 140 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(bool&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))': 141 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:91:79: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 142 | addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); 143 | ^ 144 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:55:6: note: declared here 145 | void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) 146 | ^~~~~~~~~~~~~~~~~~~~ 147 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(float&, String, permissionType, long int, void (*)(), float, void (*)(Property&))': 148 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:107:84: warning: 'void ArduinoIoTCloudClass::addPropertyReal(float&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 149 | addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); 150 | ^ 151 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:22:0: 152 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:126:10: note: declared here 153 | void addPropertyReal(float& property, String name, int tag, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 154 | ^~~~~~~~~~~~~~~ 155 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(float&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))': 156 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:113:79: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 157 | addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); 158 | ^ 159 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:55:6: note: declared here 160 | void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) 161 | ^~~~~~~~~~~~~~~~~~~~ 162 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(int&, String, permissionType, long int, void (*)(), float, void (*)(Property&))': 163 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:129:84: warning: 'void ArduinoIoTCloudClass::addPropertyReal(int&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 164 | addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); 165 | ^ 166 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:22:0: 167 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:127:10: note: declared here 168 | void addPropertyReal(int& property, String name, int tag, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 169 | ^~~~~~~~~~~~~~~ 170 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(int&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))': 171 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:135:79: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 172 | addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); 173 | ^ 174 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:55:6: note: declared here 175 | void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) 176 | ^~~~~~~~~~~~~~~~~~~~ 177 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(String&, String, permissionType, long int, void (*)(), float, void (*)(Property&))': 178 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:151:84: warning: 'void ArduinoIoTCloudClass::addPropertyReal(String&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 179 | addPropertyReal(property, name, -1, permission_type, seconds, fn, minDelta, synFn); 180 | ^ 181 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:22:0: 182 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:128:10: note: declared here 183 | void addPropertyReal(String& property, String name, int tag, permissionType permission_type = READWRITE, long seconds = ON_CHANGE, void(*fn)(void) = NULL, float minDelta = 0.0f, void(*synFn)(Property & property) = CLOUD_WINS) __attribute__((deprecated("Use addProperty(property, Permission::ReadWrite) instead."))); 184 | ^~~~~~~~~~~~~~~ 185 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp: In member function 'void ArduinoIoTCloudClass::addPropertyReal(String&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))': 186 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:157:79: warning: 'void ArduinoIoTCloudClass::addPropertyReal(Property&, String, int, permissionType, long int, void (*)(), float, void (*)(Property&))' is deprecated: Use addProperty(property, Permission::ReadWrite) instead. [-Wdeprecated-declarations] 187 | addPropertyReal(*p, name, tag, permission_type, seconds, fn, minDelta, synFn); 188 | ^ 189 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.cpp:55:6: note: declared here 190 | void ArduinoIoTCloudClass::addPropertyReal(Property& property, String name, int tag, permissionType permission_type, long seconds, void(*fn)(void), float minDelta, void(*synFn)(Property & property)) 191 | ^~~~~~~~~~~~~~~~~~~~ 192 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/PropertyContainer.h:25:0, 193 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBORDecoder.h:29, 194 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloud.h:32, 195 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloudTCP.h:27, 196 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloudTCP.cpp:25: 197 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h: In member function 'virtual void CloudTelevision::setAttributesFromCloud()': 198 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:229:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 199 | setAttribute((int&)_cloud_value.pbc); 200 | ^ 201 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 202 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 203 | ^ 204 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:230:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 205 | setAttribute((int&)_cloud_value.inp); 206 | ^ 207 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 208 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 209 | ^ 210 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloudTCP.cpp:28:0: 211 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/utility/CryptoUtil.h: In copy constructor 'CryptoUtil::CryptoUtil(const CryptoUtil&)': 212 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/utility/CryptoUtil.h:60:33: warning: unused parameter 'other' [-Wunused-parameter] 213 | CryptoUtil(CryptoUtil const & other) { } 214 | ^~~~~ 215 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloudTCP.cpp: In member function 'ArduinoIoTCloudTCP::State ArduinoIoTCloudTCP::handle_SyncTime()': 216 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/ArduinoIoTCloudTCP.cpp:208:23: warning: unused variable 'internal_posix_time' [-Wunused-variable] 217 | unsigned long const internal_posix_time = _time_service.getTime(); 218 | ^~~~~~~~~~~~~~~~~~~ 219 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/PropertyContainer.h:25:0, 220 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBOREncoder.h:25, 221 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBOREncoder.cpp:22: 222 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h: In member function 'virtual void CloudTelevision::setAttributesFromCloud()': 223 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:229:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 224 | setAttribute((int&)_cloud_value.pbc); 225 | ^ 226 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 227 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 228 | ^ 229 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:230:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 230 | setAttribute((int&)_cloud_value.inp); 231 | ^ 232 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 233 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 234 | ^ 235 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/PropertyContainer.h:25:0, 236 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBORDecoder.h:29, 237 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/CBORDecoder.cpp:28: 238 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h: In member function 'virtual void CloudTelevision::setAttributesFromCloud()': 239 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:229:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 240 | setAttribute((int&)_cloud_value.pbc); 241 | ^ 242 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 243 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 244 | ^ 245 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/types/automation/CloudTelevision.h:230:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 246 | setAttribute((int&)_cloud_value.inp); 247 | ^ 248 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/../property/Property.h:45:42: note: in definition of macro 'setAttribute' 249 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 250 | ^ 251 | /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/stdio.h: In function 'open_memstream': 252 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/open_memstream.c:108:1: warning: control reaches end of non-void function [-Wreturn-type] 253 | } 254 | ^ 255 | At top level: 256 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/open_memstream.c:77:12: warning: 'close_buffer' defined but not used [-Wunused-function] 257 | static int close_buffer(void *cookie) 258 | ^~~~~~~~~~~~ 259 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/cbor/lib/tinycbor/src/open_memstream.c:52:16: warning: 'write_to_buffer' defined but not used [-Wunused-function] 260 | static RetType write_to_buffer(void *cookie, const char *data, LenType len) 261 | ^~~~~~~~~~~~~~~ 262 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/PropertyContainer.h:25:0, 263 | from /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/PropertyContainer.cpp:22: 264 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/types/automation/CloudTelevision.h: In member function 'virtual void CloudTelevision::setAttributesFromCloud()': 265 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/types/automation/CloudTelevision.h:229:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 266 | setAttribute((int&)_cloud_value.pbc); 267 | ^ 268 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/Property.h:45:42: note: in definition of macro 'setAttribute' 269 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 270 | ^ 271 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/types/automation/CloudTelevision.h:230:39: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] 272 | setAttribute((int&)_cloud_value.inp); 273 | ^ 274 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/property/Property.h:45:42: note: in definition of macro 'setAttribute' 275 | #define setAttribute(x) setAttributeReal(x, getAttributeName(#x, '.')) 276 | ^ 277 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/BearSSLClient.cpp:35:0: 278 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/BearSSLClient.h: In constructor 'BearSSLClient::BearSSLClient(Client*, const br_x509_trust_anchor*, int, GetTimeCallbackFunc)': 279 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/BearSSLClient.h:95:8: warning: 'BearSSLClient::_noSNI' will be initialized after [-Wreorder] 280 | bool _noSNI; 281 | ^~~~~~ 282 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/BearSSLClient.h:93:23: warning: 'long unsigned int (* BearSSLClient::_get_time_func)()' [-Wreorder] 283 | GetTimeCallbackFunc _get_time_func; 284 | ^~~~~~~~~~~~~~ 285 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/BearSSLClient.cpp:39:1: warning: when initialized here [-Wreorder] 286 | BearSSLClient::BearSSLClient(Client* client, const br_x509_trust_anchor* myTAs, int myNumTAs, GetTimeCallbackFunc func) : 287 | ^~~~~~~~~~~~~ 288 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/profile/aiotc_profile.c: In function 'aiotc_client_profile_init': 289 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/profile/aiotc_profile.c:54:7: warning: unused variable 'id' [-Wunused-variable] 290 | int id; 291 | ^~ 292 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/utility/CryptoUtil.cpp:22:0: 293 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/utility/CryptoUtil.h: In copy constructor 'CryptoUtil::CryptoUtil(const CryptoUtil&)': 294 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/tls/utility/CryptoUtil.h:60:33: warning: unused parameter 'other' [-Wunused-parameter] 295 | CryptoUtil(CryptoUtil const & other) { } 296 | ^~~~~ 297 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/utility/time/NTPUtils.cpp:25:0: 298 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/utility/time/NTPUtils.h:57:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 299 | static char constexpr * NTP_TIME_SERVER = "time.arduino.cc"; 300 | ^~~~~~~~~~~~~~~~~ 301 | In file included from /github/home/Arduino/libraries/ArduinoIoTCloud/src/utility/time/TimeService.cpp:26:0: 302 | /github/home/Arduino/libraries/ArduinoIoTCloud/src/utility/time/NTPUtils.h:57:53: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 303 | static char constexpr * NTP_TIME_SERVER = "time.arduino.cc"; 304 | ^~~~~~~~~~~~~~~~~ 305 | In file included from /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0, 306 | from /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd.h:105, 307 | from /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/sam.h:540, 308 | from /github/home/.arduino15/packages/arduino/hardware/samd/1.8.8/cores/arduino/Arduino.h:48, 309 | from /github/home/Arduino/libraries/RTCZero/src/RTCZero.h:23, 310 | from /github/home/Arduino/libraries/RTCZero/src/RTCZero.cpp:22: 311 | /github/home/.arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined 312 | #define LITTLE_ENDIAN 1 313 | 314 | In file included from /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/sys/types.h:67:0, 315 | from /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/time.h:28, 316 | from /github/home/Arduino/libraries/RTCZero/src/RTCZero.cpp:20: 317 | /github/home/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/arm-none-eabi/include/machine/endian.h:17:0: note: this is the location of the previous definition 318 | #define LITTLE_ENDIAN _LITTLE_ENDIAN 319 | 320 | /github/home/Arduino/libraries/RTCZero/src/RTCZero.cpp: In member function 'void RTCZero::begin(bool)': 321 | /github/home/Arduino/libraries/RTCZero/src/RTCZero.cpp:96:26: warning: 'oldTime.RTC_MODE2_CLOCK_Type::reg' may be used uninitialized in this function [-Wmaybe-uninitialized] 322 | RTC->MODE2.CLOCK.reg = oldTime.reg; 323 | Sketch uses 134184 bytes (51%) of program storage space. Maximum is 262144 bytes. 324 | Global variables use 23208 bytes (70%) of dynamic memory, leaving 9560 bytes for local variables. Maximum is 32768 bytes. 325 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------