Skip to content

Commit fc1b5c3

Browse files
polldoper1234
andauthored
CI: Add check-dependencies workflow (#120)
Add workflow to check if our dependencies are compatible with our license. Co-authored-by: per1234 <[email protected]>
1 parent 677e08b commit fc1b5c3

File tree

284 files changed

+55226
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+55226
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-dependencies-task.md
2+
name: Check Dependencies
3+
4+
env:
5+
# See: https://github.com/actions/setup-go/tree/v2#readme
6+
GO_VERSION: "1.16"
7+
8+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
9+
on:
10+
push:
11+
paths:
12+
- ".github/workflows/check-dependencies-task.ya?ml"
13+
- ".licenses/**"
14+
- ".licensed.json"
15+
- ".licensed.ya?ml"
16+
- "Taskfile.ya?ml"
17+
- "**/go.mod"
18+
- "**/go.sum"
19+
pull_request:
20+
paths:
21+
- ".github/workflows/check-dependencies-task.ya?ml"
22+
- ".licenses/**"
23+
- ".licensed.json"
24+
- ".licensed.ya?ml"
25+
- "Taskfile.ya?ml"
26+
- "**/go.mod"
27+
- "**/go.sum"
28+
workflow_dispatch:
29+
repository_dispatch:
30+
31+
jobs:
32+
check-cache:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v2
38+
39+
- name: Install licensed
40+
uses: jonabc/setup-licensed@v1
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
version: 3.x
44+
45+
- name: Install Go
46+
uses: actions/setup-go@v2
47+
with:
48+
go-version: ${{ env.GO_VERSION }}
49+
50+
- name: Install Task
51+
uses: arduino/setup-task@v1
52+
with:
53+
repo-token: ${{ secrets.GITHUB_TOKEN }}
54+
version: 3.x
55+
56+
- name: Update dependencies license metadata cache
57+
run: task --silent general:cache-dep-licenses
58+
59+
- name: Check for outdated cache
60+
id: diff
61+
run: |
62+
git add .
63+
if ! git diff --cached --color --exit-code; then
64+
echo
65+
echo "::error::Dependency license metadata out of sync. See: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-go-dependencies-task.md#metadata-cache"
66+
exit 1
67+
fi
68+
69+
# Some might find it convenient to have CI generate the cache rather than setting up for it locally
70+
- name: Upload cache to workflow artifact
71+
if: failure() && steps.diff.outcome == 'failure'
72+
uses: actions/upload-artifact@v2
73+
with:
74+
if-no-files-found: error
75+
name: dep-licenses-cache
76+
path: .licenses/
77+
78+
check-deps:
79+
runs-on: ubuntu-latest
80+
81+
steps:
82+
- name: Checkout repository
83+
uses: actions/checkout@v2
84+
85+
- name: Install licensed
86+
uses: jonabc/setup-licensed@v1
87+
with:
88+
github_token: ${{ secrets.GITHUB_TOKEN }}
89+
version: 3.x
90+
91+
- name: Install Go
92+
uses: actions/setup-go@v2
93+
with:
94+
go-version: ${{ env.GO_VERSION }}
95+
96+
- name: Install Task
97+
uses: arduino/setup-task@v1
98+
with:
99+
repo-token: ${{ secrets.GITHUB_TOKEN }}
100+
version: 3.x
101+
102+
- name: Check for dependencies with unapproved licenses
103+
run: task --silent general:check-dep-licenses

.licensed.yml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# See: https://github.com/github/licensed/blob/master/docs/configuration.md
2+
3+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies/AGPL-3.0/.licensed.yml
4+
allowed:
5+
# Based on: https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses
6+
- gpl-1.0-or-later
7+
- gpl-1.0+ # Deprecated ID for `gpl-1.0-or-later`
8+
- gpl-2.0-or-later
9+
- gpl-2.0+ # Deprecated ID for `gpl-2.0-or-later`
10+
- gpl-3.0-only
11+
- gpl-3.0 # Deprecated ID for `gpl-3.0-only`
12+
- gpl-3.0-or-later
13+
- gpl-3.0+ # Deprecated ID for `gpl-3.0-or-later`
14+
- lgpl-2.0-or-later
15+
- lgpl-2.0+ # Deprecated ID for `lgpl-2.0-or-later`
16+
- lgpl-2.1-only
17+
- lgpl-2.1 # Deprecated ID for `lgpl-2.1-only`
18+
- lgpl-2.1-or-later
19+
- lgpl-2.1+ # Deprecated ID for `lgpl-2.1-or-later`
20+
- lgpl-3.0-only
21+
- lgpl-3.0 # Deprecated ID for `lgpl-3.0-only`
22+
- lgpl-3.0-or-later
23+
- lgpl-3.0+ # Deprecated ID for `lgpl-3.0-or-later`
24+
- agpl-1.0-or-later
25+
- agpl-3.0-only
26+
- agpl-3.0 # Deprecated ID for `agpl-3.0-only`
27+
- agpl-3.0-or-later
28+
- fsfap
29+
- apache-2.0
30+
- artistic-2.0
31+
- clartistic
32+
- sleepycat
33+
- bsl-1.0
34+
- bsd-3-clause
35+
- cecill-2.0
36+
- bsd-3-clause-clear
37+
# "Cryptix General License" - no SPDX ID (https://github.com/spdx/license-list-XML/issues/456)
38+
- ecos-2.0
39+
- ecl-2.0
40+
- efl-2.0
41+
- eudatagrid
42+
- mit
43+
- bsd-2-clause # Subsumed by `bsd-2-clause-views`
44+
- bsd-2-clause-netbsd # Deprecated ID for `bsd-2-clause`
45+
- bsd-2-clause-views # This is the version linked from https://www.gnu.org/licenses/license-list.html#FreeBSD
46+
- bsd-2-clause-freebsd # Deprecated ID for `bsd-2-clause-views`
47+
- ftl
48+
- hpnd
49+
- imatix
50+
- imlib2
51+
- ijg
52+
# "Informal license" - this is a general class of license
53+
- intel
54+
- isc
55+
- mpl-2.0
56+
- ncsa
57+
# "License of Netscape JavaScript" - no SPDX ID
58+
- oldap-2.7
59+
# "License of Perl 5 and below" - possibly `Artistic-1.0-Perl` ?
60+
- cc0-1.0
61+
- cc-pddc
62+
- psf-2.0
63+
- ruby
64+
- sgi-b-2.0
65+
- smlnj
66+
- standardml-nj # Deprecated ID for `smlnj`
67+
- unicode-dfs-2015
68+
- upl-1.0
69+
- unlicense
70+
- vim
71+
- w3c
72+
- wtfpl
73+
- lgpl-2.0-or-later with wxwindows-exception-3.1
74+
- wxwindows # Deprecated ID for `lgpl-2.0-or-later with wxwindows-exception-3.1`
75+
- x11
76+
- xfree86-1.1
77+
- zlib
78+
- zpl-2.0
79+
- zpl-2.1
80+
# Based on individual license text
81+
- eupl-1.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: github.com/antihax/optional
3+
version: v1.0.0
4+
type: go
5+
summary:
6+
homepage: https://pkg.go.dev/github.com/antihax/optional
7+
license: mit
8+
licenses:
9+
- sources: LICENSE
10+
text: |
11+
The MIT License (MIT)
12+
Copyright (c) 2016 Adam Hintz
13+
14+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
15+
16+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19+
notices: []

0 commit comments

Comments
 (0)