[dependabot] Bump the actions group across 1 directory with 3 updates #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: dash | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '20 21 * * 0' | |
| permissions: # added using https://github.com/step-security/secure-repo | |
| contents: read | |
| env: | |
| JAVA_VERSION: 17 | |
| MAVEN_CLI_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false --batch-mode -Dlicense.skip=true | |
| MAVEN_COMPILE_NO_OP_ARGS: clean install -Dmaven.test.skip -Dmaven.assembly.skip=true -Dmaven.source.skip -Pskip-spark-runtimes -T4 -Dmaven.main.skip | |
| MAVEN_DASH_ARGS: org.eclipse.dash:license-tool-plugin:license-check -Ddash.fail=true -Ddash.projectId=locationtech.geomesa -DexcludeGroupIds=org.locationtech.geomesa | |
| jobs: | |
| license-check: | |
| name: license-check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 | |
| with: | |
| distribution: temurin | |
| java-version: "${{ env.JAVA_VERSION }}" | |
| - uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| key: ${{ hashFiles('**/pom.xml') }}-dash | |
| path: ~/.m2/repository/ | |
| - name: Check for dependency changes | |
| id: dependency_changes | |
| run: | | |
| changed="false" | |
| if [[ "${{ github.event_name }}" == 'pull_request' ]]; then | |
| # get the changed files | |
| git fetch --depth=1 origin ${{ github.base_ref }} | |
| IFS=$'\n' read -r -d '' -a changedFiles < <( git diff --name-only origin/${{ github.base_ref }} && printf '\0' ) | |
| echo "Changed files:" | |
| for file in "${changedFiles[@]}"; do | |
| echo " $file" | |
| if [[ -z "$changed" ]] && [[ $file =~ .*pom.xml ]]; then | |
| changed="pom" | |
| elif [[ "$file" == "build/dependencies.txt" ]]; then | |
| changed="true" | |
| fi | |
| done | |
| if [[ "$changed" == "pom" ]]; then | |
| mvn $MAVEN_COMPILE_NO_OP_ARGS $MAVEN_CLI_OPTS | |
| ./build/scripts/calculate-cqs.sh | |
| git diff --exit-code --quiet || { | |
| echo 'Detected dependency changes - please run `./build/scripts/calculate-cqs.sh` and commit the results' | |
| exit 1 | |
| } | |
| changed="false" | |
| fi | |
| else | |
| # weekly or dispatch requests | |
| changed="true" | |
| fi | |
| echo "changed=$changed" >> "$GITHUB_OUTPUT" | |
| - name: License check | |
| if: steps.dependency_changes.outputs.changed == 'true' | |
| run: | | |
| mvn $MAVEN_COMPILE_NO_OP_ARGS $MAVEN_CLI_OPTS | |
| mvn $MAVEN_DASH_ARGS $MAVEN_CLI_OPTS | |
| - name: Show license | |
| if: success() || failure() | |
| run: | | |
| if [[ -f target/dash/summary ]]; then | |
| cat target/dash/summary | |
| else | |
| echo "No dependency changes detected - skipping license check" | |
| fi | |
| - name: Remove geomesa artifacts | |
| if: success() || failure() | |
| run: | | |
| if [[ -d ~/.m2/repository/org/locationtech/geomesa ]]; then | |
| rm -rf ~/.m2/repository/org/locationtech/geomesa | |
| fi |