-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.21 KB
/
pr-ci.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Pull Request CI
on:
pull_request:
paths:
- '**.kt'
- '**.xml'
- '**.gradle'
- '.github/workflows/pr-ci.yaml'
permissions:
id-token: write
contents: read
checks: write
jobs:
pr-ci:
runs-on: ubuntu-latest
env:
HOST: http://localhost
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '17'
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set config files
run: |
echo ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON }} | base64 -d > mobile/src/debug/google-services.json
echo ${{ secrets.DEBUG_GOOGLE_SERVICES_JSON }} | base64 -d > wear/src/debug/google-services.json
- name: Start Http Docker
run: docker run -p 80:80 -d --name httpbin kennethreitz/httpbin
- name: Run build
run: ./gradlew compileDebugUnitTestJavaWithJavac
- name: Wait for the service to start
run: |
while ! curl --output /dev/null --silent --head --fail http://localhost; do
sleep 1
done
- name: Run test
run: ./gradlew testDebugUnitTest
- name: Stop Docker container
run: docker stop httpbin
- name: shared test report
uses: dorny/test-reporter@v1
if: always()
with:
name: shared test
path: shared/build/test-results/testDebugUnitTest/TEST-*.xml
reporter: java-junit
fail-on-error: false
- name: mobile test report
uses: dorny/test-reporter@v1
if: always()
with:
name: mobile test
path: mobile/build/test-results/testDebugUnitTest/TEST-*.xml
reporter: java-junit
fail-on-error: false
- name: wear test report
uses: dorny/test-reporter@v1
if: always()
with:
name: wear test
path: wear/build/test-results/testDebugUnitTest/TEST-*.xml
reporter: java-junit
fail-on-error: false