Skip to content

Commit

Permalink
Add check-dash
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbosch committed Oct 5, 2023
1 parent c781b47 commit 945e795
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
28 changes: 28 additions & 0 deletions check-dash/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Check dash

An action using [dash-license](https://github.com/eclipse/dash-licenses) to generate a license report and upload
results.

# How to use

You need an input file that Dash can understand, then give it as input like below

```
- name: Dash license check
uses: eclipse-kuksa/kuksa-actions/check-dash@2
with:
dashinput: ${{github.workspace}}/dash-databroker-deps
```


The uploaded result will be a zip file containing an `*.out` file with result similar to this:

```
[main] INFO Querying Eclipse Foundation for license data for 217 items.
[main] INFO Found 43 items.
[main] INFO Querying ClearlyDefined for license data for 174 items.
[main] INFO Found 174 items.
[main] INFO Vetted license information was found for all content. No further investigation is required.
```

More deatils are included in the `*.report` file. The input file is also uploaded.
34 changes: 34 additions & 0 deletions check-dash/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

name: Checking dependencies with dash-license tool
description: Check an input file via dash, and archive report. Print output in build step summary. Requires wget and will install JRE on the runner

inputs:
dashinput:
required: true
type: string
description: "Dash Input file"


runs:
using: "composite"
steps:
- name: Installing JVM, needed for Dash
shell: bash
run: sudo apt update && sudo apt-get install -y default-jre
- name: "Run Dash"
shell: bash
run: |
wget -O dash.jar "https://repo.eclipse.org/service/local/artifact/maven/redirect?r=dash-licenses&g=org.eclipse.dash&a=org.eclipse.dash.licenses&v=LATEST"
java -jar dash.jar -summary ${{ inputs.dashinput }}.report ${{ inputs.dashinput }} > ${{ inputs.dashinput }}.out 2>&1 || true
echo -e "Dash output: \n\`\`\` " >> $GITHUB_STEP_SUMMARY
cat ${{ inputs.dashinput }}.out >> $GITHUB_STEP_SUMMARY
echo -e "\n\`\`\`"
- name: "Archive dash artifacts"
uses: actions/upload-artifact@v3
with:
name: "Dash data"
path: |
${{ inputs.dashinput }}
${{ inputs.dashinput }}.report
${{ inputs.dashinput }}.out

0 comments on commit 945e795

Please sign in to comment.