-
Notifications
You must be signed in to change notification settings - Fork 32
101 lines (84 loc) · 2.89 KB
/
build_and_test.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# This workflow will build the project with Gradle, run integration tests, and release.
# Because secrets are not available on external forks, this job is expected to fail
# on external pull requests.
name: Build project & run tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'handstandsam/ShoppingApp' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up our JDK environment
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 17
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: true
matrix:
api-level:
- 29
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v1
- name: Set up our JDK environment
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 17
- name: Dependency Guard
run: ./gradlew dependencyGuard --scan --stacktrace
- name: Run All Checks - KMP4FREE Disabled
run: ./gradlew check -Pkmp4free=false -Pios=false -Pjs=false --scan --stacktrace
- name: Run All Checks with Multiplatform - KMP4FREE Enabled
run: ./gradlew check -Pkmp4free=true -Pios=true -Pjs=true --scan --stacktrace --rerun-tasks
- name: (Fail-only) Bundle test reports
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip
- name: (Fail-only) Upload the build report
if: failure()
uses: actions/upload-artifact@v2
with:
name: error-report
path: build-reports.zip
instrumentation-tests:
name: Instrumentation tests
runs-on: macos-latest
timeout-minutes: 20
strategy:
# Allow tests to continue on other devices if they fail on one device.
fail-fast: false
matrix:
api-level:
- 29
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7 # v4
with:
distribution: 'zulu'
java-version: '17'
check-latest: true
# - name: Instrumentation Tests
# uses: reactivecircus/android-emulator-runner@6b0df4b0efb23bb0ec63d881db79aefbc976e4b2 # v2
# with:
# api-level: ${{ matrix.api-level }}
# target: default
# arch: x86_64
# script: ./gradlew connectedCheck --no-build-cache --no-daemon --stacktrace
#
# - name: Upload results
# uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
# with:
# name: insrumentation-test-results
# path: ./**/build/reports/androidTests/connected/**