From dfab3d866f256477976f17ed79505b12fc43dead Mon Sep 17 00:00:00 2001 From: Andre Weber Date: Thu, 7 Dec 2023 14:06:28 +0100 Subject: [PATCH 1/2] Add GitHub Action for Dash License Check Signed-off-by: Andre Weber --- .github/workflows/dash.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/dash.yaml diff --git a/.github/workflows/dash.yaml b/.github/workflows/dash.yaml new file mode 100644 index 0000000..08ec7ba --- /dev/null +++ b/.github/workflows/dash.yaml @@ -0,0 +1,28 @@ +name: dash + +on: + pull_request: + push: + branches: + - main + +jobs: + check-dash: + runs-on: ubuntu-latest + steps: + + - name: Checkout code + uses: actions/checkout@v3 + + # taken from here: https://github.com/eclipse/dash-licenses#example-python + - name: Create Dash Dependency Report + run: | + cat kuksa-client/requirements.txt | grep -v \# \ + | sed -E -e 's|([^= ]+)==([^= ]+)|pypi/pypi/-/\1/\2|' -e 's| ||g' \ + | sort | uniq \ + > dependencies.txt + + - name: Dash license check + uses: eclipse-kuksa/kuksa-actions/check-dash@2 + with: + dashinput: ${{github.workspace}}/dependencies.txt From 93baeafb31813c9f18996fe33255b2fc33f98379 Mon Sep 17 00:00:00 2001 From: Andre Weber Date: Tue, 12 Dec 2023 08:27:26 +0100 Subject: [PATCH 2/2] Use Virtual Environment to read Dependencies --- .github/workflows/dash.yaml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dash.yaml b/.github/workflows/dash.yaml index 08ec7ba..f2a15e6 100644 --- a/.github/workflows/dash.yaml +++ b/.github/workflows/dash.yaml @@ -17,7 +17,19 @@ jobs: # taken from here: https://github.com/eclipse/dash-licenses#example-python - name: Create Dash Dependency Report run: | - cat kuksa-client/requirements.txt | grep -v \# \ + python3 -m venv ./.venv/kuksa-client + source ./.venv/kuksa-client/bin/activate + + pip install --upgrade pip + pip install -r kuksa-client/requirements.txt + + deactivate + + python3 -m venv ./.venv/pipdeptree + source ./.venv/pipdeptree/bin/activate + + pip install pipdeptree + pipdeptree -a -f --python ./.venv/kuksa-client/bin/python \ | sed -E -e 's|([^= ]+)==([^= ]+)|pypi/pypi/-/\1/\2|' -e 's| ||g' \ | sort | uniq \ > dependencies.txt