Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto TPIP check #97

Merged
merged 2 commits into from
Sep 12, 2023
Merged
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
18 changes: 12 additions & 6 deletions .github/workflows/eventlist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@ jobs:
cp tools/eventlist/docs/* release/eventlist-darwin-arm64/docs/
cp tools/eventlist/docs/* release/eventlist-windows-amd64/docs/
cp tools/eventlist/docs/* release/eventlist-windows-arm64/docs/
cp tools/eventlist/third_party_licenses.md release/eventlist-linux-amd64/
cp tools/eventlist/third_party_licenses.md release/eventlist-linux-arm64/
cp tools/eventlist/third_party_licenses.md release/eventlist-darwin-amd64/
cp tools/eventlist/third_party_licenses.md release/eventlist-darwin-arm64/
cp tools/eventlist/third_party_licenses.md release/eventlist-windows-amd64/
cp tools/eventlist/third_party_licenses.md release/eventlist-windows-arm64/

- name: Download eventlist linux
uses: actions/download-artifact@v3
Expand Down Expand Up @@ -351,12 +357,12 @@ jobs:
# https://github.com/actions/upload-artifact#permission-loss
chmod +x */eventlist*

zip -r eventlist-windows-amd64.zip eventlist-windows-amd64/eventlist.exe eventlist-windows-amd64/docs eventlist-windows-amd64/LICENSE
zip -r eventlist-windows-arm64.zip eventlist-windows-arm64/eventlist.exe eventlist-windows-arm64/docs eventlist-windows-arm64/LICENSE
tar -czvf eventlist-linux-amd64.tar.gz eventlist-linux-amd64/eventlist eventlist-linux-amd64/docs eventlist-linux-amd64/LICENSE
tar -czvf eventlist-linux-arm64.tar.gz eventlist-linux-arm64/eventlist eventlist-linux-arm64/docs eventlist-linux-arm64/LICENSE
tar -czvf eventlist-darwin-amd64.tar.gz eventlist-darwin-amd64/eventlist eventlist-darwin-amd64/docs eventlist-darwin-amd64/LICENSE
tar -czvf eventlist-darwin-arm64.tar.gz eventlist-darwin-arm64/eventlist eventlist-darwin-arm64/docs eventlist-darwin-arm64/LICENSE
zip -r eventlist-windows-amd64.zip eventlist-windows-amd64/eventlist.exe eventlist-windows-amd64/docs eventlist-windows-amd64/LICENSE eventlist-windows-amd64/third_party_licenses.md
zip -r eventlist-windows-arm64.zip eventlist-windows-arm64/eventlist.exe eventlist-windows-arm64/docs eventlist-windows-arm64/LICENSE eventlist-windows-arm64/third_party_licenses.md
tar -czvf eventlist-linux-amd64.tar.gz eventlist-linux-amd64/eventlist eventlist-linux-amd64/docs eventlist-linux-amd64/LICENSE eventlist-linux-amd64/third_party_licenses.md
tar -czvf eventlist-linux-arm64.tar.gz eventlist-linux-arm64/eventlist eventlist-linux-arm64/docs eventlist-linux-arm64/LICENSE eventlist-linux-arm64/third_party_licenses.md
tar -czvf eventlist-darwin-amd64.tar.gz eventlist-darwin-amd64/eventlist eventlist-darwin-amd64/docs eventlist-darwin-amd64/LICENSE eventlist-darwin-amd64/third_party_licenses.md
tar -czvf eventlist-darwin-arm64.tar.gz eventlist-darwin-arm64/eventlist eventlist-darwin-arm64/docs eventlist-darwin-arm64/LICENSE eventlist-darwin-arm64/third_party_licenses.md
working-directory: release

- name: Calculate checksums
Expand Down
82 changes: 82 additions & 0 deletions .github/workflows/tpip-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: TPIP Check

on:
pull_request:
paths:
- ".github/workflows/tpip-check.yml"
- "**/go.mod"
- "**/go.sum"
- "tools/eventlist/template/**"
workflow_dispatch:

env:
tpip_report: "third_party_licenses.md"

jobs:
check-licenses:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
cache-dependency-path: tools/eventlist/go.sum
go-version-file: tools/eventlist/go.mod
check-latest: true

- name: Go tidy
run: go mod tidy
working-directory: ./tools/eventlist

- name: Install go-licenses
run: go install github.com/google/go-licenses@latest

- name: Generate TPIP Report
run: |
cp LICENSE ./tools/eventlist

- name: Generate TPIP Report
run: |
go-licenses report . ../make --ignore github.com/ARM-software/CMSIS-View/tree/main/tools/eventlist --template ../../template/${{ env.tpip_report }}.template > ../../${{ env.tpip_report }}
date +"%Y/%m/%d %T" >> ../../${{ env.tpip_report }}
working-directory: ./tools/eventlist/cmd/eventlist

- name: Archive TPIP report
uses: actions/upload-artifact@v3
with:
name: tpip-report
path: ./tools/eventlist/${{ env.tpip_report }}

- name: Print TPIP Report
run: cat ${{ env.tpip_report }} >> $GITHUB_STEP_SUMMARY
working-directory: ./tools/eventlist

- name: Check Licenses
run: go-licenses check . --ignore github.com/ARM-software/CMSIS-View/tree/main/tools/eventlist --disallowed_types=forbidden,restricted
working-directory: ./tools/eventlist/cmd/eventlist

commit-changes:
needs: [ check-licenses ]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Restore Changes
uses: actions/download-artifact@v3
with:
name: tpip-report
path: ./tools/eventlist

- name: Commit Changes
shell: bash
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Update TPIP report"
git push
9 changes: 9 additions & 0 deletions tools/eventlist/template/third_party_licenses.md.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Third Party Intellectual Property (TPIP) Report for [eventlist](https://github.com/ARM-software/CMSIS-View/tree/main/tools/eventlist)

| __Name__ | __Version__ | __Licence__ |
|----------|-------------|-------------|
{{- range . }}
| {{ .Name }} | {{ .Version }} | [{{ .LicenseName }}]({{ .LicenseURL }}) |
{{- end }}

Report generated and repository checked for [forbidden](https://github.com/google/licenseclassifier/blob/842c0d70d7027215932deb13801890992c9ba364/license_type.go#L323) and [restricted](https://github.com/google/licenseclassifier/blob/842c0d70d7027215932deb13801890992c9ba364/license_type.go#L176) licenses on:
9 changes: 9 additions & 0 deletions tools/eventlist/third_party_licenses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Third Party Intellectual Property (TPIP) Report for [eventlist](https://github.com/ARM-software/CMSIS-View/tree/main/tools/eventlist)

| __Name__ | __Version__ | __Licence__ |
|----------|-------------|-------------|
| eventlist | Unknown | [Apache-2.0](Unknown) |
| github.com/akavel/rsrc | v0.10.2 | [MIT](https://github.com/akavel/rsrc/blob/v0.10.2/LICENSE.txt) |
| github.com/josephspurrier/goversioninfo | v1.4.0 | [MIT](https://github.com/josephspurrier/goversioninfo/blob/v1.4.0/LICENSE) |

Report generated and repository checked for [forbidden](https://github.com/google/licenseclassifier/blob/842c0d70d7027215932deb13801890992c9ba364/license_type.go#L323) and [restricted](https://github.com/google/licenseclassifier/blob/842c0d70d7027215932deb13801890992c9ba364/license_type.go#L176) licenses on: 2023/09/12 11:55:50