Skip to content

Bump gradle/actions from 3.2.0 to 3.3.0 #75

Bump gradle/actions from 3.2.0 to 3.3.0

Bump gradle/actions from 3.2.0 to 3.3.0 #75

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Define BUILD_LABEL
env:
INPUT: ${{ github.head_ref || github.ref_name }}
run: |
echo "BUILD_LABEL=${INPUT//\//_}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@b231772637bb498f11fdbc86052b6e8a8dc9fc92
# 2.1.2
# From https://docs.sonarqube.org/latest/analysis/github-integration/
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Set build version
# Cannot use ${BUILD_LABEL} with gradle-build-action, so stuff version
# into gradle.properties
run: sed -i 's/^version.*/version = '${BUILD_LABEL}'/;' ./gradle.properties
- name: Run tests
uses: gradle/actions/setup-gradle@6cec5d49d4d6d4bb982fbed7047db31ea6d38f11
# v3.3.0
with:
# Only write to the cache for builds on the 'main' branch (default - but here for documentation)
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
arguments: check sonar javadoc publish -s
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}