forked from apache/geronimo-yoko
-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (77 loc) · 2.8 KB
/
gradle.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Gradle-CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Check copyright Tag in Testify source files
run: |
SRC=$(find testify/ -name '*.java')
export year_modified=`git log -n 1 --pretty=format:%cd --date=format:%Y $i`
RC=0
echo "Checking copyright"
for i in $SRC; do
if grep -Eq "Copyright ([[:digit:]]{4}, ?)?$year_modified IBM Corporation and " $i; then
echo "✅ Copyright ok: $i"
else
echo "❌ Copyright not found or incorrect year in $i"
echo "🔴 Last modification year should be: $year_modified"
RC=1
fi
done
exit $RC
- name: Build with Gradle
run: ./gradlew build
- name: Upload test reports
uses: actions/upload-artifact@v3.1.0
if: always()
with:
name: reports
path: '*/build/reports'
- name: Upload xml test results
if: always() # make sure we run it every time even if test step fails
uses: actions/upload-artifact@v3.1.0
with:
name: xml-report
path: "**/test-results/**/*.xml"
- name: Upload test results to Test-hub.io
if: always() # make sure we run it every time even if test step fails
uses: testhub-io/testhub-io.action@v0.62
with:
test_result_pattern: "**/test-results/**/*.xml"
- name: Link to Test-hub.io
if: always()
run: echo "https://test-hub.io/OpenLiberty/projects/yoko/runs/$GITHUB_RUN_NUMBER"
- name: Check JAR licenses
run: |
JARS=$(find ./ -name '*.jar' -type f | grep yoko | grep libs)
SHIPPED_JARS=("osgi" "util" "spec-corba" "rmi-spec" "rmi-impl" "core" "testify")
for shippedJar in ${SHIPPED_JARS[@]}; do
for jar in $JARS; do
if [[ $(basename $jar) == *"$shippedJar"* ]]; then
echo "Checking $(basename $jar)"
if $(unzip -p $jar META-INF/MANIFEST.MF | grep -q "Bundle-License: https://www.apache.org/licenses/LICENSE-2.0.txt"); then
echo "License found"
else
echo "License not found"
exit 1
fi
else
continue
fi
done
done