Skip to content

Merge pull request #331 from gocd-contrib/gradlew-update-9.0.0 #204

Merge pull request #331 from gocd-contrib/gradlew-update-9.0.0

Merge pull request #331 from gocd-contrib/gradlew-update-9.0.0 #204

# 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: Test and Build
on:
push:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
docker-version: # See https://endoflife.date/docker-engine / https://download.docker.com/linux/static/stable/x86_64/
- "v25.0.5" # 2024-01 --> EOL ?
- "v28.3.1" # 2025-04 --> EOL ?
fail-fast: false
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: 17
distribution: temurin
- name: Set up Docker
uses: docker/setup-docker-action@b60f85385d03ac8acfca6d9996982511d8620a19 # v4.3.0
with:
version: ${{ matrix.docker-version }}
set-host: 'true'
- run: docker swarm init
- name: Test with Gradle
run: ./gradlew assemble check
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
if: github.ref == 'refs/heads/master'
env:
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: runtimeClasspath
previewGithubRelease:
needs: test
runs-on: ubuntu-latest
env:
GITHUB_USER: "gocd-contrib"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
with:
java-version: 17
distribution: temurin
- name: Test with Gradle
run: ./gradlew githubRelease