Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 15a5e88

Browse files
[skip changelog] Automate license headers checks in CI (#2177)
1 parent b0d8ff8 commit 15a5e88

File tree

10 files changed

+160
-0
lines changed

10 files changed

+160
-0
lines changed

‎.github/workflows/check-go-task.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,41 @@ jobs:
219219
- name: Check whether any tidying was needed
220220
run: git diff --color --exit-code
221221

222+
check-license-headers:
223+
name: check-license-headers (${{ matrix.module.path }})
224+
needs: run-determination
225+
if: needs.run-determination.outputs.result == 'true'
226+
runs-on: ubuntu-latest
227+
228+
strategy:
229+
fail-fast: false
230+
231+
matrix:
232+
module:
233+
- path: ./
234+
235+
steps:
236+
- name: Checkout repository
237+
uses: actions/checkout@v3
238+
239+
- name: Install Go
240+
uses: actions/setup-go@v4
241+
with:
242+
go-version: ${{ env.GO_VERSION }}
243+
244+
- name: Install Task
245+
uses: arduino/setup-task@v1
246+
with:
247+
repo-token: ${{ secrets.GITHUB_TOKEN }}
248+
version: 3.x
249+
250+
- name: Check for missing license headers
251+
env:
252+
GO_MODULE_PATH: ${{ matrix.module.path }}
253+
run: |
254+
task go:add-license-headers
255+
git diff --color --exit-code
256+
222257
# Do a simple "smoke test" build for the modules with no other form of validation
223258
build:
224259
name: build (${{ matrix.module.path }})

‎Taskfile.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ tasks:
142142
- easyjson arduino/cores/packageindex/index.go
143143
- easyjson arduino/libraries/librariesindex/json.go
144144

145+
go:add-license-headers:
146+
desc: Add missing go license headers
147+
cmds:
148+
- go install github.com/google/addlicense@v1.1.1
149+
- addlicense -c "ARDUINO SA (http://www.arduino.cc/)" -f ./license_header.tpl **/*.go
150+
145151
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-markdown-task/Taskfile.yml
146152
markdown:check-links:
147153
desc: Check for broken links

‎arduino/discovery/testdata/cat/main.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
// Echo stdin to stdout.
217
// This program is used for testing purposes, to make it available on all
318
// OS a tool equivalent to UNIX "cat".

‎commands/lib/search_test.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
package lib
217

318
import (

‎commands/sketch/new_test.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
package sketch
217

318
import (

‎configuration/configuration_schema_test.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
package configuration
217

318
import (

‎executils/testdata/delay/main.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
package main
217

318
import (

‎i18n/cmd/po/merge_test.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
package po
217

318
import (

‎internal/cli/arguments/completion.go‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2023 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
116
package arguments
217

318
import (

‎license_header.tpl‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
This file is part of arduino-cli.
2+
3+
Copyright{{ if .Year }} {{.Year}}{{ end }} {{.Holder}}
4+
5+
This software is released under the GNU General Public License version 3,
6+
which covers the main part of arduino-cli.
7+
The terms of this license can be found at:
8+
https://www.gnu.org/licenses/gpl-3.0.en.html
9+
10+
You can be released from the requirements of the above licenses by purchasing
11+
a commercial license. Buying such a license is mandatory if you want to
12+
modify or otherwise use the software for commercial activities involving the
13+
Arduino software without disclosing the source code of your own applications.
14+
To purchase a commercial license, send an email to license@arduino.cc.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /