Skip to content

Merge pull request #6 from build-extensions-oss/operating-systems #9

Merge pull request #6 from build-extensions-oss/operating-systems

Merge pull request #6 from build-extensions-oss/operating-systems #9

Workflow file for this run

name: Pre Merge Checks
on:
push:
branches:
- "master" # run on master branch only - no need to start the job automatically otherwise
pull_request:
branches:
- "**" # run on PRs targeting ANY branch (assuming we check the Gradle wrapper first)
workflow_dispatch:
permissions:
contents: read
jobs:
gradle:
strategy:
fail-fast: false
matrix:
# build project on some operating systems
os: [ubuntu-latest, windows-latest, macos-latest]
# build on different java versions
jdk: [ 11, 17, 21 ]
runs-on: ${{ matrix.os }}
steps:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle#using-the-gradle-starter-workflow
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
with:
egress-policy: audit
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# Protect from putting custom jar as a gradle wrapper
# https://github.com/gradle/actions/tree/main/wrapper-validation
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v5
# setup JDK - depending on version selected
# https://github.com/marketplace/actions/setup-java-jdk
- name: Set up JDK
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
# Optimize Gradle execution
# https://github.com/marketplace/actions/build-with-gradle
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
# Build the project by simply running the command line
# No need to use daemon (this is run once container), however we print detailed logs and stacktraces
- name: Assemble the project
run: ./gradlew build --stacktrace --info --no-daemon