Files
starter-workflows/ci/gradle.yml
T

68 lines
2.3 KiB
YAML
Raw Normal View History

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
2021-08-24 18:25:52 +03:00
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
2022-10-10 11:12:22 +00:00
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
2020-03-17 11:17:19 +00:00
name: Java CI with Gradle
on:
push:
2020-07-13 12:12:41 -07:00
branches: [ $default-branch ]
2020-03-17 11:17:19 +00:00
pull_request:
2020-07-13 12:12:41 -07:00
branches: [ $default-branch ]
2020-03-17 11:17:19 +00:00
jobs:
build:
runs-on: ubuntu-latest
2024-01-31 04:56:20 -07:00
permissions:
contents: read
2020-03-17 11:17:19 +00:00
steps:
2024-01-31 04:56:20 -07:00
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
2020-03-17 11:17:19 +00:00
with:
2024-01-31 04:56:20 -07:00
java-version: '17'
distribution: 'temurin'
2024-01-31 04:56:20 -07:00
2024-05-22 10:25:41 -04:00
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
2024-01-31 13:29:02 -07:00
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
2024-01-31 04:56:20 -07:00
- name: Setup Gradle
2024-08-07 11:04:34 -06:00
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
2024-01-31 04:56:20 -07:00
2024-01-31 13:29:02 -07:00
- name: Build with Gradle Wrapper
2024-01-31 04:56:20 -07:00
run: ./gradlew build
2024-01-31 13:29:02 -07:00
# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
2024-01-31 13:36:52 -07:00
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
2024-01-31 13:29:02 -07:00
#
# - name: Setup Gradle
2024-08-07 11:04:34 -06:00
# uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
2024-01-31 13:29:02 -07:00
# with:
2024-08-07 11:04:34 -06:00
# gradle-version: '8.9'
2024-01-31 13:29:02 -07:00
#
2024-08-07 11:04:34 -06:00
# - name: Build with Gradle 8.9
2024-01-31 13:29:02 -07:00
# run: gradle build
2024-01-31 13:36:52 -07:00
2024-01-31 04:56:20 -07:00
dependency-submission:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
2024-01-31 04:56:20 -07:00
java-version: '17'
distribution: 'temurin'
2024-01-31 15:07:12 -07:00
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
2024-01-31 13:29:02 -07:00
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
2024-01-31 04:56:20 -07:00
- name: Generate and submit dependency graph
2024-08-07 11:04:34 -06:00
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0