-
Notifications
You must be signed in to change notification settings - Fork 7
64 lines (61 loc) · 2.12 KB
/
update-conformance-test-reports.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Update conformance test reports
on:
repository_dispatch:
types: [update-conformance-test-reports]
workflow_dispatch: # for testing this workflow
permissions: write-all
jobs:
update:
name: Update conformance test reports
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
branch: update-conformance-test-reports
defaults:
run:
shell: bash --noprofile --norc -e -o pipefail -x {0}
working-directory: reference-checker
steps:
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Check out JSpecify
uses: actions/checkout@v3
with:
repository: jspecify/jspecify
ref: main
path: jspecify
- name: Check out the Reference Checker
uses: actions/checkout@v3
with:
fetch-depth: 0
path: reference-checker
- name: Create or update the Reference Checker ${{ env.branch }} branch
run: |
git config user.name 'jspecify-bot'
git config user.email '[email protected]'
if git checkout "${branch}"; then
git merge -X theirs origin/main
git push
else
git checkout -b "${branch}"
git config push.autoSetupRemote true
fi
- name: Run the Reference Checker conformance tests
uses: gradle/gradle-build-action@v2
with:
arguments: conformanceTest conformanceTestOnSamples
build-root-directory: reference-checker
env:
JSPECIFY_CONFORMANCE_TEST_MODE: write
- name: Create or update PR to update conformance test reports
run: |
if [[ -n $(git status --porcelain tests/ConformanceTest*-report.txt) ]]; then
git commit -m "Update conformance test reports." tests/ConformanceTest*-report.txt
git push
if [[ -z $(gh pr list --head "${branch}" --state open) ]]; then
gh pr create --base main --title "Update conformance test reports." --body ""
fi
fi