feat: Deterministic Gradle build #1355
Workflow file for this run
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
# SPDX-License-Identifier: Apache-2.0 | ||
name: "PR Gradle Checks" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- release/* | ||
pull_request: | ||
branches: | ||
- "*" | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
GRADLE_EXEC: ./gradlew | ||
permissions: | ||
id-token: write | ||
contents: read | ||
jobs: | ||
check-gradle: | ||
name: Gradle | ||
uses: ./.github/workflows/zxc-verify-gradle-build-determinism.yaml | ||
with: | ||
ref: ${{ github.event.inputs.ref || '' }} | ||
java-distribution: ${{ inputs.java-distribution || 'temurin' }} | ||
java-version: ${{ inputs.java-version || '21.0.5' }} | ||
check-docker: | ||
Check failure on line 32 in .github/workflows/pr-checks.yaml GitHub Actions / PR Gradle ChecksInvalid workflow file
|
||
name: Docker | ||
uses: ./.github/workflows/zxc-verify-docker-build-determinism.yaml | ||
with: | ||
ref: ${{ github.event.inputs.ref || '' }} | ||
java-distribution: ${{ inputs.java-distribution || 'temurin' }} | ||
java-version: ${{ inputs.java-version || '21.0.5' }} | ||
compile: | ||
name: "Gradle Checks" | ||
runs-on: block-node-linux-medium | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2 | ||
with: | ||
egress-policy: audit | ||
- name: Checkout code | ||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
fetch-depth: 0 | ||
- name: Expand Shallow Clone for Spotless | ||
run: | | ||
if [ -f .git/shallow ]; then | ||
git fetch --unshallow --no-recurse-submodules | ||
else | ||
echo "Repository is not shallow, no need to unshallow." | ||
fi | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 | ||
with: | ||
distribution: "temurin" | ||
java-version: "21.0.5" | ||
- name: Cache Gradle packages | ||
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build | ||
id: gradle-build | ||
run: ${GRADLE_EXEC} assemble --scan | ||
- name: Style Check | ||
id: spotless-check | ||
run: ${GRADLE_EXEC} qualityCheck --continue --scan | ||
- name: Unit Tests | ||
id: unit-tests | ||
run: ${GRADLE_EXEC} check --scan | ||
- name: Upload coverage report | ||
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} |