1.21.1 #246
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |