@@ -3,13 +3,11 @@ name: License check
33
44on :
55 push :
6- branches-ignore : # build all branches except:
7- - ' dependabot/**' # prevent GHA triggered twice (once for commit to the branch and once for opening/syncing the PR)
8- tags-ignore : # don't build tags
6+ branches-ignore : # build all branches except:
7+ - ' dependabot/**' # prevent GHA triggered twice (once for commit to the branch and once for opening/syncing the PR)
8+ tags-ignore : # don't build tags
99 - ' **'
1010 pull_request :
11- branches :
12- - ' **'
1311 workflow_dispatch :
1412 # https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
1513 inputs :
1816 default : " "
1917 type : string
2018
19+
2120defaults :
2221 run :
2322 shell : bash
2423
24+
2525env :
2626 JAVA_VERSION : 17
2727
28+
2829jobs :
2930
31+ # ##########################################################
3032 license_check :
33+ # ##########################################################
3134
3235 runs-on : ubuntu-latest
3336
3437 steps :
38+ - name : " Show: GitHub context"
39+ env :
40+ GITHUB_CONTEXT : ${{ toJSON(github) }}
41+ run : echo $GITHUB_CONTEXT
42+
43+
44+ - name : " Show: environment variables"
45+ run : env | sort
46+
47+
3548 - name : Git Checkout
36- uses : actions/checkout@v4 # https://github.com/actions/checkout
49+ uses : actions/checkout@v4 # https://github.com/actions/checkout
50+
3751
3852 - name : " Install: JDK ${{ env.JAVA_VERSION }} ☕"
39- uses : actions/setup-java@v4 # https://github.com/actions/setup-java
53+ uses : actions/setup-java@v4 # https://github.com/actions/setup-java
4054 with :
4155 distribution : temurin
4256 java-version : ${{ env.JAVA_VERSION }}
4357
58+
4459 - name : " Cache: Local Maven Repository"
45- uses : actions/cache@v4
60+ uses : actions/cache/restore @v4
4661 with :
47- # Excluded sub directory not working https://github.com/actions/cache /issues/494#issuecomment-948783891
62+ # Excluded sub directory not working https://github.com/actions/toolkit /issues/713
4863 path : |
4964 ~/.m2/repository/*
5065 !~/.m2/repository/.cache/tycho
5166 !~/.m2/repository/.meta/p2-artifacts.properties
5267 !~/.m2/repository/p2
5368 !~/.m2/repository/*SNAPSHOT*
54- key : ${{ runner.os }}-repo-mvn-${{ hashFiles('**/pom.xml') }}
69+ key : ${{ runner.os }}-${{ runner.arch }}-repo-mvn-${{ hashFiles('**/pom.xml') }}
70+
5571
5672 - name : " Cache: Local Tycho Repository"
57- uses : actions/cache@v4
73+ uses : actions/cache/restore @v4
5874 with :
5975 path : |
6076 ~/.m2/repository/.cache/tycho
6177 ~/.m2/repository/.meta/p2-artifacts.properties
6278 ~/.m2/repository/p2
63- key : ${{ runner.os }}-repo-tycho-${{ hashFiles('target-platforms/oldest.target') }}
79+ key : ${{ runner.os }}-${{ runner.arch }}-repo-tycho-${{ hashFiles('target-platforms/oldest.target') }}
80+
6481
6582 - name : " Install: Maven"
66- uses : stCarolas/setup-maven@v5 # https://github.com/stCarolas/setup-maven
83+ uses : stCarolas/setup-maven@v5 # https://github.com/stCarolas/setup-maven
6784 with :
6885 maven-version : 3.9.6
6986
70- - name : Dash License check # see https://github.com/eclipse/dash-licenses
87+
88+ - name : Dash License check # see https://github.com/eclipse/dash-licenses
7189 env :
7290 DASH_IPLAB_TOKEN : " ${{ inputs.dash-iplab-token }}"
7391 run : |
7492 set -eu
7593
76- MAVEN_OPTS+=" -Djava.security.egd=file:/dev/./urandom" # https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for/59097932#59097932
94+ MAVEN_OPTS="${MAVEN_OPTS:-}"
95+ if [[ "${{ runner.os }}" == "Windows" ]]; then
96+ MAVEN_OPTS+=" -Djava.security.egd=file:/dev/urandom" # https://www.baeldung.com/java-security-egd#bd-testing-the-effect-of-javasecurityegd
97+ else
98+ MAVEN_OPTS+=" -Djava.security.egd=file:/dev/./urandom" # https://stackoverflow.com/questions/58991966/what-java-security-egd-option-is-for/59097932#59097932
99+ fi
77100 MAVEN_OPTS+=" -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss,SSS" # https://stackoverflow.com/questions/5120470/how-to-time-the-different-stages-of-maven-execution/49494561#49494561
78- MAVEN_OPTS+=" -Xmx1024m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dhttps.protocols=TLSv1.2"
79- echo " -> MAVEN_OPTS: $MAVEN_OPTS"
101+ MAVEN_OPTS+=" -Xmx1024m -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dhttps.protocols=TLSv1.3,TLSv1.2"
80102 export MAVEN_OPTS
103+ echo "MAVEN_OPTS: $MAVEN_OPTS"
81104
82- # "excludeArtifactIds" parameter is to prevent builds from failing with:
83- # License information could not be automatically verified for the following content:
84- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.core/0.5.2-SNAPSHOT
85- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.feature/0.5.4-SNAPSHOT
86- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.language_pack.feature/0.1.1-SNAPSHOT
87- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.language_pack/0.1.1-SNAPSHOT
88- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.languageconfiguration/0.5.4-SNAPSHOT
89- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.markdown/0.5.1-SNAPSHOT
90- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.registry/0.6.3-SNAPSHOT
91- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.samples/0.4.1-SNAPSHOT
92- # maven/mavencentral/org.eclipse/org.eclipse.tm4e.ui/0.6.2-SNAPSHOT
93- # p2/orbit/p2.p2.installable.unit/org.eclipse.rcp_root/4.24.0.v20220607-0700
94- # p2/orbit/p2.eclipse.plugin/org.eclipse.ui.tests.harness/1.10.0.v20230220-1021
95- # This content is either not correctly mapped by the system, or requires review.
96- # Error: Dependency license check failed. Some dependencies need to be vetted.
105+ if [[ ${ACT:-} == "true" ]]; then # when running locally using nektos/act
106+ maven_args="-Djgit.dirtyWorkingTree=warning"
107+ else
108+ maven_args="--no-transfer-progress"
109+ fi
97110
98111 mvn \
99112 --errors \
100113 --update-snapshots \
101114 --batch-mode \
102115 --show-version \
103- --no-transfer-progress \
104116 -Dtycho.disableP2Mirrors=true \
117+ $maven_args \
105118 org.eclipse.dash:license-tool-plugin:license-check \
106119 -Dtycho.target.eager=true \
107120 -Ddash.projectId=technology.tm4e \
@@ -121,6 +134,7 @@ jobs:
121134 org.eclipse.tm4e.ui,\
122135 org.eclipse.ui.tests.harness
123136
137+
124138 - name : Dash Summary
125139 if : always()
126140 run : cat DEPENDENCIES
0 commit comments