Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions workflow-templates/assets/check-go-task/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,10 @@ tasks:
dir: "{{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
cmds:
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
go:check-license-headers:
desc: Check go license headers
cmds:
- go install github.com/google/addlicense@v1.1.1
- addlicense -c "ARDUINO SA (http://www.arduino.cc/)" -f ./license_header.tpl *.go
35 changes: 35 additions & 0 deletions workflow-templates/check-go-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,38 @@ jobs:

- name: Check whether any tidying was needed
run: git diff --color --exit-code

check-license-headers:
name: check-license-headers (${{ matrix.module.path }})
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

strategy:
fail-fast: false

matrix:
module:
- path: ./

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Check license headers
env:
GO_MODULE_PATH: ${{ matrix.module.path }}
run: |
task go:check-license-headers
git diff --color --exit-code