Skip to content

Disable Gradle build cache for JitPack #114

Disable Gradle build cache for JitPack

Disable Gradle build cache for JitPack #114

Workflow file for this run

name: build
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
# TODO: Might have to give additional permissions for uploading accuracy report diff
# as artifact for pull requests? But could this have security implications?
jobs:
build:
name: Build project
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build and test
# Don't automatically download JDK toolchain; existing JDK of this workflow should be compatible
run: ./gradlew build -Porg.gradle.java.installations.auto-download=false
- name: Check accuracy reports regression
id: check-accuracy-reports
run: |
./gradlew accuracyReport -Pdetectors=Lingua
echo "Checking for diff"
# --exit-code causes exit code 1 if difference is detected
git diff --output=accuracy-reports.diff --exit-code
- name: Upload accuracy reports diff
uses: actions/upload-artifact@v4
# Only run if accuracy reports differ
if: failure() && steps.check-accuracy-reports.outcome == 'failure'
with:
name: accuracy-reports-diff
path: accuracy-reports.diff