Skip to content

Update GitHub actions #96

Update GitHub actions

Update GitHub actions #96

Workflow file for this run

name: build
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
# TODO: This is probably needed (?), but will not work for PR (and if possible, would give too much permissions?)?
# actions: write # to upload artifact for accuracy report diff
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@v3
with:
distribution: 'temurin'
java-version: 11
cache: 'gradle'
- name: Build and test
run: ./gradlew build
- 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@v3
# Only run if accuracy reports differ
if: failure() && steps.check-accuracy-reports.outcome == 'failure'
with:
name: accuracy-reports-diff
path: accuracy-reports.diff
# Stop Gradle daemon to avoid having it cause issues for workflow cache creation
- name: Stop Gradle daemon
run: |
./gradlew --stop