Merge pull request #120 from bjhargrave/dependabot/github_actions/act… #229
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'CI Build' | |
on: | |
push: | |
branches-ignore: | |
- 'dependabot/**' | |
paths: | |
- '**' | |
- '!docs/**' | |
- '!.github/**' | |
- '.github/**/*ci*' | |
pull_request: | |
paths: | |
- '**' | |
- '!docs/**' | |
- '!.github/**' | |
- '.github/**/*ci*' | |
env: | |
LC_ALL: en_US.UTF-8 | |
GRADLE_OPTS: >- | |
-Dorg.gradle.parallel=true | |
defaults: | |
run: | |
shell: bash | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
fail-fast: ${{ (github.repository != 'bjhargrave/add-maven-descriptor') || ((github.ref != 'refs/heads/main') && (github.ref != 'refs/heads/release')) || (github.event_name == 'pull_request') }} | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
java: | |
- '8' | |
- '11' | |
- '17' | |
- '21' | |
name: Build JDK${{ matrix.java }} ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
downloads.gradle.org:443 | |
github.com:443 | |
jcenter.bintray.com:443 | |
objects.githubusercontent.com:443 | |
plugins-artifacts.gradle.org:443 | |
plugins.gradle.org:443 | |
repo.maven.apache.org:443 | |
services.gradle.org:443 | |
- name: Git Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Setup Java ${{ matrix.java }} | |
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0 | |
with: | |
distribution: 'temurin' | |
java-version: ${{ matrix.java }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@16bf8bc8fe830fa669c3c9f914d3eb147c629707 # v4.0.1 | |
with: | |
cache-read-only: ${{ github.ref != 'refs/heads/main' }} | |
- name: Build | |
id: build | |
run: | | |
./gradlew build |