Skip to content

Commit 6437a88

Browse files
Add 3PP license check as part of PR CI
The license check can be triggered locally: yarn license:check For automatic opening of IP tickets for suspicious depedencies, set an Eclipse Foundation gitlab token as environment variable "DASH_TOKEN" and run the alternate pacakge.json script. e.g.: export DASH_TOKEN="<your token>" yarn license:check:reviewAdd 3PP license check as part of PR CI Closes #1040 Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
1 parent ddb5ca7 commit 6437a88

5 files changed

Lines changed: 1997 additions & 1928 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 3PP License Check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
pull_request:
9+
branches:
10+
- master
11+
schedule:
12+
- cron: '0 4 * * *' # Runs every day at 4am: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
13+
14+
jobs:
15+
16+
License-check:
17+
name: 3PP License Check using dash-licenses
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
node: [18]
24+
java: [11]
25+
26+
runs-on: ${{ matrix.os }}
27+
timeout-minutes: 20
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 2
34+
35+
- name: Use Node.js ${{ matrix.node }}
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: ${{ matrix.node }}
39+
40+
- name: Use Java ${{ matrix.java }}
41+
uses: actions/setup-java@v3
42+
with:
43+
distribution: 'adopt'
44+
java-version: ${{ matrix.java }}
45+
46+
- name: Run dash-licenses
47+
shell: bash
48+
run: |
49+
yarn --frozen-lockfile
50+
yarn license:check
51+
env:
52+
DASH_TOKEN: ${{ secrets.DASH_LICENSES_PAT }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ node_modules/
1717
theia-extensions/viewer-prototype/lib/
1818
trace-compass-server
1919
trace-compass-server.tar.gz
20+
license-check-summary.txt*
21+
e

configs/license-check-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"project": "ecd.cdt-cloud",
3+
"review": false,
4+
"inputFile": "yarn.lock",
5+
"batch": 50,
6+
"timeout": 200,
7+
"summary": "license-check-summary.txt"
8+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"format:write": "lerna run format:write",
2525
"format:check": "lerna run format:check",
2626
"browser": "yarn -s --cwd examples/browser",
27-
"electron": "yarn -s --cwd examples/electron"
27+
"electron": "yarn -s --cwd examples/electron",
28+
"license:check": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json",
29+
"license:check:review": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json --review"
2830
},
2931
"keywords": [
3032
"theia-extension",
@@ -48,6 +50,7 @@
4850
"@types/react-dom": "^18.0.6"
4951
},
5052
"devDependencies": {
53+
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
5154
"@theia/cli": "1.43.1",
5255
"concurrently": "^8.2.1",
5356
"jsonc-parser": "^3.0.0",

0 commit comments

Comments
 (0)