-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (56 loc) · 1.69 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
name: Main Branch
on:
push:
jobs:
build:
name: build
runs-on: ubuntu-latest
strategy:
matrix:
java-version: [ 17, 21 ]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
cache: 'gradle'
distribution: 'temurin'
java-version: ${{ matrix.java-version }}
- name: Setup and execute Gradle
uses: gradle/gradle-build-action@v2
- name: Run Gradle build
shell: bash
run: >-
export SPRING_PROFILES_ACTIVE=test && ./gradlew build --no-daemon --info
- name: Generate file
run: |
cd build/libs/
ls -ltra
mv trap-*.jar trap.jar
java -jar trap.jar
- name: Test file exists
run: |
cd build/libs/
test -f league-data-*.xlsx || exit 1
- name: Test file was generate properly
run: |
cd build/libs/
file1size=$(stat -c %s league-data-*.xlsx)
echo "file 1 size successful"
file2size=$(stat -c %s ../../src/main/resources/main-template.xlsx)
echo "file 2 size successful"
echo "file1size"
echo $file1size
echo "file2size"
echo $file2size
if [ "$file1size" -lt "$file2size" ]; then
echo "file 1 is smaller"
exit 1
fi
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: my-artifact
path: build/libs/league-data-*.xlsx