-
-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (52 loc) · 1.84 KB
/
continuous-integration.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: Continuous Integration
on:
push:
branches:
- main
pull_request:
jobs:
Testing:
name: Build and Test Java v${{ matrix.java }} from ${{ matrix.java-distribution }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java: [8, 11, 17]
java-distribution: [temurin, corretto, microsoft]
exclude:
- java: 8
java-distribution: microsoft
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Setup Java 8
uses: actions/setup-java@v3
with:
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java }}
cache: gradle
- name: Build Java Code [Self]
if: github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository
uses: gradle/gradle-build-action@v2
with:
arguments: build
env:
PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }}
PGP_SIGNING_PASSWORD: ${{ secrets.PGP_SIGNING_PASSWORD }}
- name: Prepare building Java Code [Fork]
if: github.event.pull_request != null && github.event.pull_request.head.repo.full_name != github.repository
shell: bash
run: |
if [ $OS = 'macos-latest' ]; then
sed -i '' 's/this.enabled = true/this.enabled = false/g' build.gradle.kts
else
sed -i 's/this.enabled = true/this.enabled = false/g' build.gradle.kts
fi
env:
OS: ${{ matrix.os }}
- name: Build Java Code [Fork]
if: github.event.pull_request != null && github.event.pull_request.head.repo.full_name != github.repository
uses: gradle/gradle-build-action@v2
with:
arguments: build