-
Notifications
You must be signed in to change notification settings - Fork 485
54 lines (51 loc) · 1.98 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
name: Java CI
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
build:
name: Test on java-version ${{ matrix.java-version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
java-version: ['8', '11', '17']
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Check limited Guava usage
if: matrix.os == 'ubuntu-latest'
run: |
if grep --with-filename --line-number --no-messages --recursive --exclude-dir=.github "com.google.common.base.Objects" .; then
echo "Error: use java.util.Objects instead of com.google.common.base.Objects"
exit 1
fi
- name: Setup java ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
- name: Set environment variables
run: |
echo "DEV_VERSION=$(./gradlew properties | awk '/^version:/ { print $2 }')" >> $GITHUB_ENV
echo "RELEASE_VERSION=$(./gradlew properties -Prelease | awk '/^version:/ { print $2 }')" >> $GITHUB_ENV
- name: Gradle build on Ununtu
if: matrix.os == 'ubuntu-latest'
run: |
./gradlew build
./gradlew runFunctionalTest
javac -cp api/build/libs/minio-${DEV_VERSION}-all.jar functional/TestUserAgent.java
java -Dversion=${DEV_VERSION} -cp api/build/libs/minio-${DEV_VERSION}-all.jar:functional TestUserAgent
./gradlew clean
./gradlew build -Prelease
javac -cp api/build/libs/minio-${RELEASE_VERSION}-all.jar functional/TestUserAgent.java
java -Dversion=${RELEASE_VERSION} -cp api/build/libs/minio-${RELEASE_VERSION}-all.jar:functional TestUserAgent
- name: Gradle build on Windows
if: matrix.os == 'windows-latest'
run: |
$Env:Path += ';.'
gradlew.bat build
gradlew.bat runFunctionalTest