Skip to content

Fix reproducible location url (#71) #133

Fix reproducible location url (#71)

Fix reproducible location url (#71) #133

name: Build and Test
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # Allows sonar to collect blame information
- name: Setup Gradle
uses: gradle/actions/setup-gradle@31ae3562f68c96d481c31bc1a8a55cc1be162f83
# v3.4.1
with:
validate-wrappers: true
- name: Cache SonarCloud packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Run tests
run: ./gradlew check javadoc publish sonar -s -Pversion=${BUILD_LABEL//\//_}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
BUILD_LABEL: ${{ github.head_ref || github.ref_name }}