-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.42 KB
/
tests.yaml
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
name: tests
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
# https://github.com/actions/runner-images/issues/7506
- name: Accept Android SDK license
run: echo "y" | /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0-rc3"
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build
run: ./gradlew :app:buildDebug
- name: Test
run: ./gradlew :app:testDebug
- name: Snapshot test
id: snapshots
run: ./gradlew :app:verifyPaparazziDebug
- name: Upload snapshot failures
id: upload-snapshot-failures
if: ${{ failure() && steps.snapshots.conclusion == 'failure' }}
run: ./upload-snapshots-diff.sh
env:
COMMIT_SHA: ${{ github.sha }}
ASSETS_TOKEN: ${{ secrets.ASSETS_TOKEN }}
DIFFS_PATH: ${{ github.workspace }}/app/build/paparazzi/failures
- name: Add snapshots report
if: ${{ failure() && steps.snapshots.conclusion == 'failure' }}
uses: mshick/add-pr-comment@v2
with:
message: ${{ steps.upload-snapshot-failures.outputs.SNAPSHOT_REPORT_MESSAGE }}