Skip to content

Commit

Permalink
feat: update DEPENDENCIES, add check to CI (#566)
Browse files Browse the repository at this point in the history
* chore: update DEPENDENCIES, add check to CI

* use grep not ack

* issue warning when restricted dependencies found

* pr remark: look for rejected deps as well
  • Loading branch information
paullatzelsperger authored Jul 5, 2023
1 parent c1b625d commit d31eebe
Show file tree
Hide file tree
Showing 2 changed files with 405 additions and 254 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,33 @@ jobs:
git diff
exit 1
fi
verify-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-java
- name: Download latest Eclipse Dash
run: |
curl -L https://repo.eclipse.org/service/local/artifact/maven/redirect\?r\=dash-licenses\&g\=org.eclipse.dash\&a\=org.eclipse.dash.licenses\&v\=LATEST --output dash.jar
- name: Regenerate DEPENDENCIES
run: |
# dash returns a nonzero exit code if there are libs that need review. the "|| true" avoids that
./gradlew allDependencies | grep -Poh "(?<=\s)[\w.-]+:[\w.-]+:[^:\s\[\]]+" | sort | uniq | java -jar dash.jar - -summary DEPENDENCIES-gen || true
# log warning if restricted deps are found
grep -E 'restricted' DEPENDENCIES | if test $(wc -l) -gt 0; then
echo "::warning file=DEPENDENCIES,title=Restricted Dependencies found::Some dependencies are marked 'restricted' - please review them"
fi
# log error and fail job if rejected deps are found
grep -E 'rejected' DEPENDENCIES | if test $(wc -l) -gt 0; then
echo "::error file=DEPENDENCIES,title=Rejected Dependencies found::Some dependencies are marked 'rejected', they cannot be used"
exit 1
fi
- name: Check for differences
run: |
diff DEPENDENCIES DEPENDENCIES-gen
verify-formatting:
runs-on: ubuntu-latest
Expand Down
Loading

0 comments on commit d31eebe

Please sign in to comment.