-
Notifications
You must be signed in to change notification settings - Fork 70
70 lines (56 loc) · 2.31 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
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
name: Java CI with Gradle
on:
push:
branches: [ "main", "SRU2024_v10" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
# Set the JDK 11 for the latest code branch (Prowide Core v10)
- name: Set up JDK 11
if: github.ref == 'refs/heads/SRU2024_v10' || github.head_ref == 'SRU2024_v10'
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
# Set the JDK 8 for the legacy code branch
- name: Set up JDK 8
if: github.ref != 'refs/heads/SRU2024_v10' && github.head_ref != 'SRU2024_v10'
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build with Gradle Wrapper
run: ./gradlew -Dorg.gradle.jvmargs="-Xms512m -Xmx7g" compileJava compileTestJava
- name: Run test
run: ./gradlew test --info
# This job generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# We only do it for the SRU2024_v10 branch to avoid spamming the Dependabot alerts for the legacy Java 8 code.
dependency-submission:
if: github.ref == 'refs/heads/SRU2024_v10' || github.head_ref == 'SRU2024_v10'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@v4
with:
dependency-graph-exclude-projects: ':buildSrc'