├── .codespellrc ├── .ecrc ├── .editorconfig ├── .flake8 ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── config.yml │ └── feature-request.yml ├── dependabot.yml └── workflows │ ├── check-action-metadata-task.yml │ ├── check-files-task.yml │ ├── check-general-formatting-task.yml │ ├── check-license.yml │ ├── check-markdown-task.yml │ ├── check-npm-task.yml │ ├── check-poetry-task.yml │ ├── check-prettier-formatting-task.yml │ ├── check-python-task.yml │ ├── check-taskfiles.yml │ ├── check-toc-task.yml │ ├── check-workflows-task.yml │ ├── check-yaml-task.yml │ ├── spell-check-task.yml │ ├── sync-labels-npm.yml │ ├── test-integration.yml │ ├── test-python-poetry-task.yml │ └── testdata │ ├── platforms │ ├── PyserialDependent │ │ ├── boards.txt │ │ └── platform.txt │ └── PythonPackageDependent │ │ ├── boards.txt │ │ ├── dependent.py │ │ └── platform.txt │ ├── reports │ └── all-inputs │ │ ├── arduino-avr-uno.json │ │ └── esp8266-esp8266-huzzah.json │ └── sketches │ ├── BareMinimum │ └── BareMinimum.ino │ ├── Error │ └── Error.ino │ ├── ServoLibrary │ └── ServoLibrary.ino │ └── TestCompileFlags │ └── TestCompileFlags.ino ├── .gitignore ├── .markdown-link-check.json ├── .markdownlint.yml ├── .markdownlintignore ├── .prettierignore ├── .yamllint.yml ├── LICENSE.txt ├── README.md ├── Taskfile.yml ├── action.yml ├── codecov.yml ├── compilesketches ├── compilesketches.py └── tests │ ├── test_compilesketches.py │ └── testdata │ ├── HasSketches │ ├── NoSketches │ │ └── NotSketch │ │ │ └── NotSketch.foo │ ├── NotSketch │ │ └── Foo.bar │ ├── Sketch1 │ │ ├── Sketch1.ino │ │ └── Sketch1b.ino │ └── Sketch2 │ │ └── Sketch2.pde │ ├── NoSketches │ └── NotSketch │ │ └── NotSketch.foo │ ├── githubevent.json │ ├── test_get_archive_root_folder_name │ ├── has-file │ │ ├── not-root.foo │ │ └── not-root │ │ │ └── .gitkeep │ ├── has-folders │ │ ├── also-not-root │ │ │ └── .gitkeep │ │ └── not-root │ │ │ └── .gitkeep │ └── has-root │ │ ├── __MACOSX │ │ └── .gitkeep │ │ └── root │ │ └── .gitkeep │ └── test_get_warning_count_from_output │ ├── has-warnings.txt │ └── no-warnings.txt ├── docs └── FAQ.md ├── package-lock.json ├── package.json ├── poetry.lock ├── pyproject.toml └── pytest.ini /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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/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/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 | -------------------------------------------------------------------------------- /.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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-action-metadata-task.ya?ml" 14 | - "action.ya?ml" 15 | - "package.json" 16 | - "package-lock.json" 17 | - "Taskfile.ya?ml" 18 | pull_request: 19 | paths: 20 | - ".github/workflows/check-action-metadata-task.ya?ml" 21 | - "action.ya?ml" 22 | - "package.json" 23 | - "package-lock.json" 24 | - "Taskfile.ya?ml" 25 | schedule: 26 | # Run every Tuesday at 8 AM UTC to catch breakage from changes to the JSON schema. 27 | - cron: "0 8 * * TUE" 28 | workflow_dispatch: 29 | repository_dispatch: 30 | 31 | jobs: 32 | run-determination: 33 | runs-on: ubuntu-latest 34 | permissions: {} 35 | outputs: 36 | result: ${{ steps.determination.outputs.result }} 37 | steps: 38 | - name: Determine if the rest of the workflow should run 39 | id: determination 40 | run: | 41 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 42 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 43 | if [[ 44 | "${{ github.event_name }}" != "create" || 45 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 46 | ]]; then 47 | # Run the other jobs. 48 | RESULT="true" 49 | else 50 | # There is no need to run the other jobs. 51 | RESULT="false" 52 | fi 53 | 54 | echo "result=$RESULT" >> $GITHUB_OUTPUT 55 | 56 | validate: 57 | needs: run-determination 58 | if: needs.run-determination.outputs.result == 'true' 59 | runs-on: ubuntu-latest 60 | permissions: 61 | contents: read 62 | 63 | steps: 64 | - name: Checkout repository 65 | uses: actions/checkout@v4 66 | 67 | - name: Setup Node.js 68 | uses: actions/setup-node@v4 69 | with: 70 | node-version: ${{ env.NODE_VERSION }} 71 | 72 | - name: Install Task 73 | uses: arduino/setup-task@v2 74 | with: 75 | repo-token: ${{ secrets.GITHUB_TOKEN }} 76 | version: 3.x 77 | 78 | - name: Validate action.yml 79 | run: task --silent action:validate 80 | -------------------------------------------------------------------------------- /.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@v4 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@v4 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-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@v4 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.0 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-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@v4 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 | -------------------------------------------------------------------------------- /.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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-markdown-task.ya?ml" 14 | - ".markdown-link-check.json" 15 | - "package.json" 16 | - "package-lock.json" 17 | - "Taskfile.ya?ml" 18 | - "**/.markdownlint*" 19 | - "**.mdx?" 20 | - "**.mkdn" 21 | - "**.mdown" 22 | - "**.markdown" 23 | pull_request: 24 | paths: 25 | - ".github/workflows/check-markdown-task.ya?ml" 26 | - ".markdown-link-check.json" 27 | - "package.json" 28 | - "package-lock.json" 29 | - "Taskfile.ya?ml" 30 | - "**/.markdownlint*" 31 | - "**.mdx?" 32 | - "**.mkdn" 33 | - "**.mdown" 34 | - "**.markdown" 35 | schedule: 36 | # Run every Tuesday at 8 AM UTC to catch breakage caused by external changes. 37 | - cron: "0 8 * * TUE" 38 | workflow_dispatch: 39 | repository_dispatch: 40 | 41 | jobs: 42 | run-determination: 43 | runs-on: ubuntu-latest 44 | permissions: {} 45 | outputs: 46 | result: ${{ steps.determination.outputs.result }} 47 | steps: 48 | - name: Determine if the rest of the workflow should run 49 | id: determination 50 | run: | 51 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 52 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 53 | if [[ 54 | "${{ github.event_name }}" != "create" || 55 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 56 | ]]; then 57 | # Run the other jobs. 58 | RESULT="true" 59 | else 60 | # There is no need to run the other jobs. 61 | RESULT="false" 62 | fi 63 | 64 | echo "result=$RESULT" >> $GITHUB_OUTPUT 65 | 66 | lint: 67 | needs: run-determination 68 | if: needs.run-determination.outputs.result == 'true' 69 | runs-on: ubuntu-latest 70 | permissions: 71 | contents: read 72 | 73 | steps: 74 | - name: Checkout repository 75 | uses: actions/checkout@v4 76 | 77 | - name: Setup Node.js 78 | uses: actions/setup-node@v4 79 | with: 80 | node-version: ${{ env.NODE_VERSION }} 81 | 82 | - name: Initialize markdownlint-cli problem matcher 83 | uses: xt0rted/markdownlint-problem-matcher@v3 84 | 85 | - name: Install Task 86 | uses: arduino/setup-task@v2 87 | with: 88 | repo-token: ${{ secrets.GITHUB_TOKEN }} 89 | version: 3.x 90 | 91 | - name: Lint 92 | run: task markdown:lint 93 | 94 | links: 95 | needs: run-determination 96 | if: needs.run-determination.outputs.result == 'true' 97 | runs-on: ubuntu-latest 98 | permissions: 99 | contents: read 100 | 101 | steps: 102 | - name: Checkout repository 103 | uses: actions/checkout@v4 104 | 105 | - name: Setup Node.js 106 | uses: actions/setup-node@v4 107 | with: 108 | node-version: ${{ env.NODE_VERSION }} 109 | 110 | - name: Install Task 111 | uses: arduino/setup-task@v2 112 | with: 113 | repo-token: ${{ secrets.GITHUB_TOKEN }} 114 | version: 3.x 115 | 116 | - name: Check links 117 | run: task --silent markdown:check-links 118 | -------------------------------------------------------------------------------- /.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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-npm-task.ya?ml" 14 | - "**/package.json" 15 | - "**/package-lock.json" 16 | - "Taskfile.ya?ml" 17 | pull_request: 18 | paths: 19 | - ".github/workflows/check-npm-task.ya?ml" 20 | - "**/package.json" 21 | - "**/package-lock.json" 22 | - "Taskfile.ya?ml" 23 | schedule: 24 | # Run every Tuesday at 8 AM UTC to catch breakage resulting 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 | name: validate (${{ matrix.project.path }}) 56 | needs: run-determination 57 | if: needs.run-determination.outputs.result == 'true' 58 | runs-on: ubuntu-latest 59 | permissions: 60 | contents: read 61 | 62 | strategy: 63 | fail-fast: false 64 | matrix: 65 | project: 66 | - path: . 67 | 68 | steps: 69 | - name: Checkout repository 70 | uses: actions/checkout@v4 71 | 72 | - name: Setup Node.js 73 | uses: actions/setup-node@v4 74 | with: 75 | node-version: ${{ env.NODE_VERSION }} 76 | 77 | - name: Install Task 78 | uses: arduino/setup-task@v2 79 | with: 80 | repo-token: ${{ secrets.GITHUB_TOKEN }} 81 | version: 3.x 82 | 83 | - name: Validate package.json 84 | run: task --silent npm:validate PROJECT_PATH="${{ matrix.project.path }}" 85 | 86 | check-sync: 87 | name: check-sync (${{ matrix.project.path }}) 88 | needs: run-determination 89 | if: needs.run-determination.outputs.result == 'true' 90 | runs-on: ubuntu-latest 91 | permissions: 92 | contents: read 93 | 94 | strategy: 95 | fail-fast: false 96 | matrix: 97 | project: 98 | - path: . 99 | 100 | steps: 101 | - name: Checkout repository 102 | uses: actions/checkout@v4 103 | 104 | - name: Setup Node.js 105 | uses: actions/setup-node@v4 106 | with: 107 | node-version: ${{ env.NODE_VERSION }} 108 | 109 | - name: Install Task 110 | uses: arduino/setup-task@v2 111 | with: 112 | repo-token: ${{ secrets.GITHUB_TOKEN }} 113 | version: 3.x 114 | 115 | - name: Install npm dependencies 116 | run: task npm:install-deps PROJECT_PATH="${{ matrix.project.path }}" 117 | 118 | - name: Check package-lock.json 119 | run: git diff --color --exit-code "${{ matrix.project.path }}/package-lock.json" 120 | -------------------------------------------------------------------------------- /.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@v4 58 | 59 | - name: Install Python 60 | uses: actions/setup-python@v5 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@v4 86 | 87 | - name: Install Python 88 | uses: actions/setup-python@v5 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-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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-prettier-formatting-task.ya?ml" 14 | - "Taskfile.ya?ml" 15 | - "**/.prettierignore" 16 | - "**/.prettierrc*" 17 | # CSS 18 | - "**.css" 19 | - "**.wxss" 20 | # PostCSS 21 | - "**.pcss" 22 | - "**.postcss" 23 | # Less 24 | - "**.less" 25 | # SCSS 26 | - "**.scss" 27 | # GraphQL 28 | - "**.graphqls?" 29 | - "**.gql" 30 | # handlebars 31 | - "**.handlebars" 32 | - "**.hbs" 33 | # HTML 34 | - "**.mjml" 35 | - "**.html?" 36 | - "**.html.hl" 37 | - "**.st" 38 | - "**.xht" 39 | - "**.xhtml" 40 | # Vue 41 | - "**.vue" 42 | # JavaScript 43 | - "**.flow" 44 | - "**._?jsb?" 45 | - "**.bones" 46 | - "**.cjs" 47 | - "**.es6?" 48 | - "**.frag" 49 | - "**.gs" 50 | - "**.jake" 51 | - "**.jscad" 52 | - "**.jsfl" 53 | - "**.js[ms]" 54 | - "**.[mn]js" 55 | - "**.pac" 56 | - "**.wxs" 57 | - "**.[xs]s?js" 58 | - "**.xsjslib" 59 | # JSX 60 | - "**.jsx" 61 | # TypeScript 62 | - "**.ts" 63 | # TSX 64 | - "**.tsx" 65 | # JSON 66 | - "**/.eslintrc" 67 | - "**.json" 68 | - "**.avsc" 69 | - "**.geojson" 70 | - "**.gltf" 71 | - "**.har" 72 | - "**.ice" 73 | - "**.JSON-tmLanguage" 74 | - "**.mcmeta" 75 | - "**.tfstate" 76 | - "**.topojson" 77 | - "**.webapp" 78 | - "**.webmanifest" 79 | - "**.yyp?" 80 | # JSONC 81 | - "**/.babelrc" 82 | - "**/.jscsrc" 83 | - "**/.js[hl]intrc" 84 | - "**.jsonc" 85 | - "**.sublime-*" 86 | # JSON5 87 | - "**.json5" 88 | # Markdown 89 | - "**.mdx?" 90 | - "**.markdown" 91 | - "**.mk?down" 92 | - "**.mdwn" 93 | - "**.mkdn?" 94 | - "**.ronn" 95 | - "**.workbook" 96 | # YAML 97 | - "**/.clang-format" 98 | - "**/.clang-tidy" 99 | - "**/.gemrc" 100 | - "**/glide.lock" 101 | - "**.ya?ml*" 102 | - "**.mir" 103 | - "**.reek" 104 | - "**.rviz" 105 | - "**.sublime-syntax" 106 | - "**.syntax" 107 | pull_request: 108 | paths: 109 | - ".github/workflows/check-prettier-formatting-task.ya?ml" 110 | - "Taskfile.ya?ml" 111 | - "**/.prettierignore" 112 | - "**/.prettierrc*" 113 | # CSS 114 | - "**.css" 115 | - "**.wxss" 116 | # PostCSS 117 | - "**.pcss" 118 | - "**.postcss" 119 | # Less 120 | - "**.less" 121 | # SCSS 122 | - "**.scss" 123 | # GraphQL 124 | - "**.graphqls?" 125 | - "**.gql" 126 | # handlebars 127 | - "**.handlebars" 128 | - "**.hbs" 129 | # HTML 130 | - "**.mjml" 131 | - "**.html?" 132 | - "**.html.hl" 133 | - "**.st" 134 | - "**.xht" 135 | - "**.xhtml" 136 | # Vue 137 | - "**.vue" 138 | # JavaScript 139 | - "**.flow" 140 | - "**._?jsb?" 141 | - "**.bones" 142 | - "**.cjs" 143 | - "**.es6?" 144 | - "**.frag" 145 | - "**.gs" 146 | - "**.jake" 147 | - "**.jscad" 148 | - "**.jsfl" 149 | - "**.js[ms]" 150 | - "**.[mn]js" 151 | - "**.pac" 152 | - "**.wxs" 153 | - "**.[xs]s?js" 154 | - "**.xsjslib" 155 | # JSX 156 | - "**.jsx" 157 | # TypeScript 158 | - "**.ts" 159 | # TSX 160 | - "**.tsx" 161 | # JSON 162 | - "**/.eslintrc" 163 | - "**.json" 164 | - "**.avsc" 165 | - "**.geojson" 166 | - "**.gltf" 167 | - "**.har" 168 | - "**.ice" 169 | - "**.JSON-tmLanguage" 170 | - "**.mcmeta" 171 | - "**.tfstate" 172 | - "**.topojson" 173 | - "**.webapp" 174 | - "**.webmanifest" 175 | - "**.yyp?" 176 | # JSONC 177 | - "**/.babelrc" 178 | - "**/.jscsrc" 179 | - "**/.js[hl]intrc" 180 | - "**.jsonc" 181 | - "**.sublime-*" 182 | # JSON5 183 | - "**.json5" 184 | # Markdown 185 | - "**.mdx?" 186 | - "**.markdown" 187 | - "**.mk?down" 188 | - "**.mdwn" 189 | - "**.mkdn?" 190 | - "**.ronn" 191 | - "**.workbook" 192 | # YAML 193 | - "**/.clang-format" 194 | - "**/.clang-tidy" 195 | - "**/.gemrc" 196 | - "**/glide.lock" 197 | - "**.ya?ml*" 198 | - "**.mir" 199 | - "**.reek" 200 | - "**.rviz" 201 | - "**.sublime-syntax" 202 | - "**.syntax" 203 | schedule: 204 | # Run periodically to catch breakage caused by external changes. 205 | - cron: "0 4 * * WED" 206 | workflow_dispatch: 207 | repository_dispatch: 208 | 209 | jobs: 210 | run-determination: 211 | runs-on: ubuntu-latest 212 | permissions: {} 213 | outputs: 214 | result: ${{ steps.determination.outputs.result }} 215 | steps: 216 | - name: Determine if the rest of the workflow should run 217 | id: determination 218 | run: | 219 | RELEASE_BRANCH_REGEX="^refs/heads/v[0-9]+$" 220 | # The `create` event trigger doesn't support `branches` filters, so it's necessary to use Bash instead. 221 | if [[ 222 | "${{ github.event_name }}" != "create" || 223 | "${{ github.ref }}" =~ $RELEASE_BRANCH_REGEX 224 | ]]; then 225 | # Run the other jobs. 226 | RESULT="true" 227 | else 228 | # There is no need to run the other jobs. 229 | RESULT="false" 230 | fi 231 | 232 | echo "result=$RESULT" >> $GITHUB_OUTPUT 233 | 234 | check: 235 | needs: run-determination 236 | if: needs.run-determination.outputs.result == 'true' 237 | runs-on: ubuntu-latest 238 | permissions: 239 | contents: read 240 | 241 | steps: 242 | - name: Checkout repository 243 | uses: actions/checkout@v4 244 | 245 | - name: Setup Node.js 246 | uses: actions/setup-node@v4 247 | with: 248 | node-version: ${{ env.NODE_VERSION }} 249 | 250 | - name: Install Task 251 | uses: arduino/setup-task@v2 252 | with: 253 | repo-token: ${{ secrets.GITHUB_TOKEN }} 254 | version: 3.x 255 | 256 | - name: Format with Prettier 257 | run: task general:format-prettier 258 | 259 | - name: Check formatting 260 | run: git diff --color --exit-code 261 | -------------------------------------------------------------------------------- /.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@v4 68 | 69 | - name: Install Python 70 | uses: actions/setup-python@v5 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@v4 96 | 97 | - name: Install Python 98 | uses: actions/setup-python@v5 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-taskfiles.yml: -------------------------------------------------------------------------------- 1 | # Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-taskfiles.md 2 | name: Check Taskfiles 3 | 4 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-taskfiles.ya?ml" 14 | - "package.json" 15 | - "package-lock.json" 16 | - "**/Taskfile.ya?ml" 17 | pull_request: 18 | paths: 19 | - ".github/workflows/check-taskfiles.ya?ml" 20 | - "package.json" 21 | - "package-lock.json" 22 | - "**/Taskfile.ya?ml" 23 | schedule: 24 | # Run every Tuesday at 8 AM UTC to catch breakage resulting 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 | name: Validate ${{ matrix.file }} 56 | needs: run-determination 57 | if: needs.run-determination.outputs.result == 'true' 58 | runs-on: ubuntu-latest 59 | permissions: 60 | contents: read 61 | 62 | strategy: 63 | fail-fast: false 64 | 65 | matrix: 66 | file: 67 | - ./**/Taskfile.yml 68 | 69 | steps: 70 | - name: Checkout repository 71 | uses: actions/checkout@v4 72 | 73 | - name: Setup Node.js 74 | uses: actions/setup-node@v4 75 | with: 76 | node-version: ${{ env.NODE_VERSION }} 77 | 78 | - name: Download JSON schema for Taskfiles 79 | id: download-schema 80 | uses: carlosperate/download-file-action@v2 81 | with: 82 | # Source: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/taskfile.json 83 | file-url: https://taskfile.dev/schema.json 84 | location: ${{ runner.temp }}/taskfile-schema 85 | 86 | - name: Install JSON schema validator 87 | run: npm install 88 | 89 | - name: Validate ${{ matrix.file }} 90 | run: | 91 | # See: https://github.com/ajv-validator/ajv-cli#readme 92 | npx \ 93 | --package=ajv-cli \ 94 | --package=ajv-formats \ 95 | ajv validate \ 96 | --all-errors \ 97 | --strict=false \ 98 | -c ajv-formats \ 99 | -s "${{ steps.download-schema.outputs.file-path }}" \ 100 | -d "${{ matrix.file }}" 101 | -------------------------------------------------------------------------------- /.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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | create: 11 | push: 12 | paths: 13 | - ".github/workflows/check-toc-task.ya?ml" 14 | - "package.json" 15 | - "package-lock.json" 16 | - "README.md" 17 | pull_request: 18 | paths: 19 | - ".github/workflows/check-toc-task.ya?ml" 20 | - "package.json" 21 | - "package-lock.json" 22 | - "README.md" 23 | schedule: 24 | # Run periodically to catch breakage caused by external changes. 25 | - cron: "0 3 * * WED" 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 | check: 55 | name: ${{ matrix.file.name }} 56 | needs: run-determination 57 | if: needs.run-determination.outputs.result == 'true' 58 | runs-on: ubuntu-latest 59 | permissions: 60 | contents: read 61 | 62 | strategy: 63 | fail-fast: false 64 | 65 | matrix: 66 | file: 67 | - name: README.md 68 | # Max ToC depth, for use with the markdown-toc --maxdepth flag. 69 | maxdepth: 5 70 | 71 | steps: 72 | - name: Checkout repository 73 | uses: actions/checkout@v4 74 | 75 | - name: Setup Node.js 76 | uses: actions/setup-node@v4 77 | with: 78 | node-version: ${{ env.NODE_VERSION }} 79 | 80 | - name: Install Task 81 | uses: arduino/setup-task@v2 82 | with: 83 | repo-token: ${{ secrets.GITHUB_TOKEN }} 84 | version: 3.x 85 | 86 | - name: Rebuild ToC 87 | run: | 88 | task markdown:toc \ 89 | FILE_PATH="${{ github.workspace }}/${{ matrix.file.name }}" \ 90 | MAX_DEPTH=${{ matrix.file.maxdepth }} 91 | 92 | - name: Check ToC 93 | run: git diff --color --exit-code 94 | -------------------------------------------------------------------------------- /.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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | 8 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 9 | on: 10 | push: 11 | paths: 12 | - ".github/workflows/*.ya?ml" 13 | - "package.json" 14 | - "package-lock.json" 15 | - "Taskfile.ya?ml" 16 | pull_request: 17 | paths: 18 | - ".github/workflows/*.ya?ml" 19 | - "package.json" 20 | - "package-lock.json" 21 | - "Taskfile.ya?ml" 22 | schedule: 23 | # Run every Tuesday at 8 AM UTC to catch breakage resulting from changes to the JSON schema. 24 | - cron: "0 8 * * TUE" 25 | workflow_dispatch: 26 | repository_dispatch: 27 | 28 | jobs: 29 | validate: 30 | runs-on: ubuntu-latest 31 | permissions: 32 | contents: read 33 | 34 | steps: 35 | - name: Checkout repository 36 | uses: actions/checkout@v4 37 | 38 | - name: Setup Node.js 39 | uses: actions/setup-node@v4 40 | with: 41 | node-version: ${{ env.NODE_VERSION }} 42 | 43 | - name: Install Task 44 | uses: arduino/setup-task@v2 45 | with: 46 | repo-token: ${{ secrets.GITHUB_TOKEN }} 47 | version: 3.x 48 | 49 | - name: Validate workflows 50 | run: task --silent ci:validate 51 | -------------------------------------------------------------------------------- /.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@v4 96 | 97 | - name: Install Python 98 | uses: actions/setup-python@v5 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/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@v4 50 | 51 | - name: Install Python 52 | uses: actions/setup-python@v5 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/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 | env: 5 | # See: https://github.com/actions/setup-node/#readme 6 | NODE_VERSION: 16.x 7 | CONFIGURATIONS_FOLDER: .github/label-configuration-files 8 | CONFIGURATIONS_ARTIFACT_PREFIX: label-configuration-file- 9 | 10 | # See: https://docs.github.com/actions/using-workflows/events-that-trigger-workflows 11 | on: 12 | push: 13 | paths: 14 | - ".github/workflows/sync-labels-npm.ya?ml" 15 | - ".github/label-configuration-files/*.ya?ml" 16 | - "package.json" 17 | - "package-lock.json" 18 | pull_request: 19 | paths: 20 | - ".github/workflows/sync-labels-npm.ya?ml" 21 | - ".github/label-configuration-files/*.ya?ml" 22 | - "package.json" 23 | - "package-lock.json" 24 | schedule: 25 | # Run daily at 8 AM UTC to sync with changes to shared label configurations. 26 | - cron: "0 8 * * *" 27 | workflow_dispatch: 28 | repository_dispatch: 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@v4 39 | 40 | - name: Setup Node.js 41 | uses: actions/setup-node@v4 42 | with: 43 | node-version: ${{ env.NODE_VERSION }} 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@v4 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@v4 126 | 127 | - name: Download configuration file artifacts 128 | uses: actions/download-artifact@v4 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@v4 141 | with: 142 | node-version: ${{ env.NODE_VERSION }} 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/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@v4 70 | with: 71 | repository: arduino-libraries/servo 72 | ref: 1.1.7 73 | 74 | - name: Checkout local repo 75 | uses: actions/checkout@v4 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@v4 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@v4 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@v4 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@v4 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@v4 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@v4 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@v4 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@v4 323 | 324 | - name: Download sketches reports artifact 325 | uses: actions/download-artifact@v4 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@v4 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 | -------------------------------------------------------------------------------- /.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@v4 72 | 73 | - name: Install Python 74 | uses: actions/setup-python@v5 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/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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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/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/testdata/sketches/BareMinimum/BareMinimum.ino: -------------------------------------------------------------------------------- 1 | void setup() {} 2 | void loop() {} 3 | -------------------------------------------------------------------------------- /.github/workflows/testdata/sketches/Error/Error.ino: -------------------------------------------------------------------------------- 1 | #error 2 | -------------------------------------------------------------------------------- /.github/workflows/testdata/sketches/ServoLibrary/ServoLibrary.ino: -------------------------------------------------------------------------------- 1 | #include 2 | void setup() {} 3 | void loop() {} 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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .licenses/ 2 | .pytest_cache/ 3 | __pycache__/ 4 | node_modules/ 5 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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@v5 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 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | coverage: 2 | range: "100...100" 3 | status: 4 | project: 5 | default: 6 | threshold: 0% 7 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/NoSketches/NotSketch/NotSketch.foo: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/NotSketch/Foo.bar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/HasSketches/NotSketch/Foo.bar -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/Sketch1/Sketch1.ino: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/HasSketches/Sketch1/Sketch1.ino -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/Sketch1/Sketch1b.ino: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/HasSketches/Sketch1/Sketch1b.ino -------------------------------------------------------------------------------- /compilesketches/tests/testdata/HasSketches/Sketch2/Sketch2.pde: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/HasSketches/Sketch2/Sketch2.pde -------------------------------------------------------------------------------- /compilesketches/tests/testdata/NoSketches/NotSketch/NotSketch.foo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/NoSketches/NotSketch/NotSketch.foo -------------------------------------------------------------------------------- /compilesketches/tests/testdata/githubevent.json: -------------------------------------------------------------------------------- 1 | { 2 | "pull_request": { 3 | "head": { 4 | "sha": "pull_request-head-sha" 5 | }, 6 | "number": 42 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-file/not-root.foo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/test_get_archive_root_folder_name/has-file/not-root.foo -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-file/not-root/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/test_get_archive_root_folder_name/has-file/not-root/.gitkeep -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-folders/also-not-root/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/test_get_archive_root_folder_name/has-folders/also-not-root/.gitkeep -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-folders/not-root/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/test_get_archive_root_folder_name/has-folders/not-root/.gitkeep -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-root/__MACOSX/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/test_get_archive_root_folder_name/has-root/__MACOSX/.gitkeep -------------------------------------------------------------------------------- /compilesketches/tests/testdata/test_get_archive_root_folder_name/has-root/root/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arduino/compile-sketches/a1f14532f940969f029184ea24b3560c1a22c557/compilesketches/tests/testdata/test_get_archive_root_folder_name/has-root/root/.gitkeep -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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.13.7", 7 | "markdown-toc": "1.2.0", 8 | "markdownlint-cli": "0.37.0", 9 | "prettier": "3.5.3" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /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.44" 10 | PyGithub = "2.6.1" 11 | PyYAML = "6.0.2" 12 | semver = "3.0.4" 13 | 14 | [tool.poetry.group.dev.dependencies] 15 | black = "25.1.0" 16 | codespell = "2.4.1" 17 | coverage = "7.8.2" 18 | pytest = "8.4.0" 19 | pytest-mock = "3.14.1" 20 | flake8 = "7.2.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.1.3" 39 | 40 | [build-system] 41 | requires = ["poetry-core"] 42 | build-backend = "poetry.core.masonry.api" 43 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------