forked from pemistahl/lingua
-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (39 loc) · 1.38 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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@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