Skip to content

Commit

Permalink
Merge pull request #269 from eclipse-cdt-cloud/automated-pr-license-c…
Browse files Browse the repository at this point in the history
…heck

Add 3PP license check as part of PR CI
  • Loading branch information
marcdumais-work authored Jan 29, 2024
2 parents 93cc807 + e2e132e commit 4f84ab1
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 1 deletion.
52 changes: 52 additions & 0 deletions .github/workflows/license-check-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 3PP License Check

on:
push:
branches:
- master
workflow_dispatch:
pull_request:
branches:
- master
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: [18]
java: [11]

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

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

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

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

- name: Run dash-licenses
shell: bash
run: |
yarn --frozen-lockfile --ignore-scripts
yarn license:check
env:
DASH_TOKEN: ${{ secrets.DASH_LICENSES_PAT }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ bundle.js
coverage
lib
node_modules
license-check-summary.txt*
8 changes: 8 additions & 0 deletions configs/license-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"project": "ecd.cdt-cloud",
"review": false,
"inputFile": "yarn.lock",
"batch": 50,
"timeout": 200,
"summary": "license-check-summary.txt"
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"start": "lerna run start",
"test": "lerna run test --",
"publish:latest": "lerna publish --registry=https://registry.npmjs.org/ --exact --no-git-tag-version --no-push",
"publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary minor --preid=next.$(date -u '+%Y%m%d%H%M%S').$(git rev-parse --short HEAD) --dist-tag=next --no-git-tag-version --no-push --yes"
"publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary minor --preid=next.$(date -u '+%Y%m%d%H%M%S').$(git rev-parse --short HEAD) --dist-tag=next --no-git-tag-version --no-push --yes",
"license:check": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json",
"license:check:review": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json --review"
},
"keywords": [
"gantt",
Expand All @@ -26,6 +28,7 @@
},
"homepage": "https://github.com/theia-ide/timeline-chart",
"devDependencies": {
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
"lerna": "^7.0.0",
"typescript": "^5.2.2"
},
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@
resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==

"@eclipse-dash/nodejs-wrapper@^0.0.1":
version "0.0.1"
resolved "https://registry.yarnpkg.com/@eclipse-dash/nodejs-wrapper/-/nodejs-wrapper-0.0.1.tgz#f2629671cf090a84c4d69a8fec42f198e583d103"
integrity sha512-Rkk8O8hEVi/+LC/co7ly1zGLVwCNJG3yPbalsz1FHAqk6WZyEaWNf29EX6jz4vTfR5wpv2xAfF2yokKuStiOdA==

"@hutson/parse-repository-url@^3.0.0":
version "3.0.2"
resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340"
Expand Down

0 comments on commit 4f84ab1

Please sign in to comment.