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

Add Automated License Check Workflow #373

Merged
merged 1 commit into from
Nov 6, 2024
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
52 changes: 52 additions & 0 deletions .github/workflows/eclipse-npm-license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 3PP License Check

on:
push:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
schedule:
- cron: "0 4 * * *" # Runs every day at 4am: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule

jobs:
License-check:
name: 3PP License Check using dash-licenses

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [20]
java: [11]

runs-on: ${{ matrix.os }}
timeout-minutes: 20

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Use Java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: ${{ matrix.java }}

- name: Run dash-licenses
shell: bash
run: |
cd node
npm ci
npm run license:check
env:
DASH_TOKEN: ${{ secrets.DASH_LICENSES_PAT }}
5 changes: 5 additions & 0 deletions .github/workflows/reusable-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ jobs:
cd ${{ inputs.path_to_package }}
mvn verify -fae --no-transfer-progress

- name: Check mvn licenses
run: |
cd ${{ inputs.path_to_package }}
mvn org.eclipse.dash:license-tool-plugin:license-check -Ddash.iplab.token=${{ secrets.DASH_LICENSES_PAT }} -Ddash.projectId=ecd.theia

publish:
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'release'
Expand Down
10 changes: 10 additions & 0 deletions java/common/maven-conf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
<quarkus.platform.version>3.11.3</quarkus.platform.version>
</properties>

<pluginRepositories>
<pluginRepository>
<id>dash-licenses-snapshots</id>
<url>https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

<profiles>
<profile>
<id>github</id>
Expand Down
9 changes: 9 additions & 0 deletions node/configs/license-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"project": "ecd.theia",
"review": true,
"inputFile": "package-lock.json",
"batch": 50,
"timeout": 200,
"summary": "license-check-summary.txt",
"exclusions": "configs/license-check-exclusions.json"
}
4 changes: 4 additions & 0 deletions node/configs/license-check-exclusions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"npm/npmjs/-/landing-page/0.1.0": "Theia Cloud Internal Package",
"npm/npmjs/-/testing-page/0.1.0": "Theia Cloud Internal Package"
}
10 changes: 10 additions & 0 deletions node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"node": ">=20.0.0"
},
"devDependencies": {
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
"@types/node": "^20.10.0",
"@typescript-eslint/eslint-plugin": "^6.18.1",
"@typescript-eslint/parser": "^6.18.1",
Expand All @@ -25,7 +26,8 @@
"lint": "npm run lint --workspaces --if-present && npm run lint:monitor",
"build:monitor": "cd monitor && npm run build",
"lint:monitor": "cd monitor && npm run lint",
"update:demo:monitor": "cd monitor && npm run update:demo:monitor"
"update:demo:monitor": "cd monitor && npm run update:demo:monitor",
"license:check": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json"
},
"workspaces": [
"common",
Expand Down