Skip to content

Commit

Permalink
Merge pull request #190 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 3e337a7 + ab7c060 commit ac4d706
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 2 deletions.
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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,5 @@ lerna-error.log*

*.vsix
*.tsbuildinfo

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 @@ -13,9 +13,12 @@
"download:sample-traces": "curl -o TraceCompassTutorialTraces.tgz https://raw.githubusercontent.com/dorsal-lab/tracevizlab/master/labs/TraceCompassTutorialTraces.tgz; tar -xf TraceCompassTutorialTraces.tgz",
"download:openvscode-server": "mkdir -p test-resources; cd test-resources; curl -L -o openvscode-server-v1.77.3-linux-x64.tar.gz https://github.com/gitpod-io/openvscode-server/releases/download/openvscode-server-v1.77.3/openvscode-server-v1.77.3-linux-x64.tar.gz; tar -xf openvscode-server-v1.77.3-linux-x64.tar.gz",
"configure:openvscode-server": "cd test-resources/openvscode-server-v1.77.3-linux-x64/bin/; sed -i 's;\"$@\".*$;\"$@\" --without-connection-token --install-extension $ROOT/../../vscode-trace-extension/vscode-trace-extension-0.1.0.vsix --default-folder=$ROOT/../../TraceCompassTutorialTraces --start-server;g' openvscode-server",
"start:openvscode-server": "cd test-resources/openvscode-server-v1.77.3-linux-x64/bin/; ./openvscode-server ${0}"
"start:openvscode-server": "cd test-resources/openvscode-server-v1.77.3-linux-x64/bin/; ./openvscode-server ${0}",
"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"
},
"devDependencies": {
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
"copy-webpack-plugin": "^11.0.0",
"eslint-config-prettier": "^9.0.0",
"lerna": "^7.0.0",
Expand Down
6 changes: 5 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,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==

"@emotion/babel-plugin@^11.11.0":
version "11.11.0"
resolved "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz#c2d872b6a7767a9d176d007f5b31f7d504bb5d6c"
Expand Down Expand Up @@ -4967,7 +4972,6 @@ js-yaml@^3.10.0, js-yaml@^3.13.1, js-yaml@^3.9.1:

json-bigint@sidorares/json-bigint#2c0a5f896d7888e68e5f4ae3c7ea5cd42fd54473:
version "1.0.0"
uid "2c0a5f896d7888e68e5f4ae3c7ea5cd42fd54473"
resolved "https://codeload.github.com/sidorares/json-bigint/tar.gz/2c0a5f896d7888e68e5f4ae3c7ea5cd42fd54473"
dependencies:
bignumber.js "^9.0.0"
Expand Down

0 comments on commit ac4d706

Please sign in to comment.