-
Notifications
You must be signed in to change notification settings - Fork 96
46 lines (41 loc) · 1.37 KB
/
build_test.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
# 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: Java CI with Gradle
on: [pull_request, workflow_dispatch]
jobs:
build:
strategy:
matrix:
java: [21]
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: configure gradle
uses: gradle/wrapper-validation-action@v1
with:
java-version: ${{matrix.java}}
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: ${{matrix.java}}
- name: Grant execute permission for gradlew
if: ${{ runner.os != 'Windows' }}
run: chmod +x gradlew
- name: Test Gradle buildscript #Test the full gradle buildscript before use it. Useful to catch publish errors.
uses: gradle/gradle-build-action@v2
with:
arguments: autoPublish --dry-run
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: collectArtifacts
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
uses: actions/upload-artifact@v2
with:
name: artifacts
path: |
artifacts