-
Notifications
You must be signed in to change notification settings - Fork 165
130 lines (125 loc) · 3.41 KB
/
pull-request-ci.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
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: PullRequest
on:
push:
branches:
- master
pull_request:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
env-job:
runs-on: ubuntu-latest
outputs:
modified-branch-name: ${{ steps.env.outputs.MODIFIED_BRANCH_NAME }}
name: Modify branch name
steps:
- name: Sets MODIFIED_BRANCH_NAME
id: env
env:
name: "${{env.BRANCH_NAME}}"
run: |
echo "MODIFIED_BRANCH_NAME=${name//\//-}" >> ${GITHUB_OUTPUT}
cat ${GITHUB_OUTPUT}
buildTest:
name: Build & Unit-Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- uses: gradle/actions/wrapper-validation@v4
- name: Build project
run: ./gradlew assembleDebug
- name: Run tests
run: ./gradlew test
- name: Jacoco
run: ./gradlew :tracker:jacocoTestReport --no-daemon
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
Check:
name: Check
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
needs:
- env-job
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Code checks
run: ./gradlew check
- name: Archive Lint report
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Matomo-Lint-${{ needs.env-job.outputs.modified-branch-name }}
path: tracker/build/reports/lint-results.html
Espresso:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
api: [ 30 ]
abi: [ x86_64 ]
tag: [ default ]
needs:
- env-job
steps:
- name: kvm support
run: |
egrep -c '(vmx|svm)' /proc/cpuinfo
id
sudo adduser $USER kvm
sudo chown -R $USER /dev/kvm
id
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: show envs
run: |
echo ${{ needs.env-job.outputs.modified-branch-name }}
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Install Android SDK
uses: hannesa2/action-android/[email protected]
- name: Run instrumentation tests
uses: hannesa2/action-android/[email protected]
with:
cmd: ./gradlew cAT --continue
api: ${{ matrix.api }}
tag: ${{ matrix.tag }}
abi: ${{ matrix.abi }}
cmdOptions: -noaudio -no-boot-anim -no-window -metrics-collection
- name: Archive Espresso results
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: matomo-Espresso-${{ needs.env-job.outputs.modified-branch-name }}
path: |
./**/build/reports/androidTests/connected
./**/build/outputs
!./**/build/outputs/apk