-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (49 loc) · 1.41 KB
/
Copy pathci.yml
File metadata and controls
53 lines (49 loc) · 1.41 KB
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
name: Build and Test
on:
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make gradlew executable
run: chmod +x ./gradlew
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- name: Run Android lint
run: ./gradlew lint
unit-tests:
name: Unit Tests & Coverage (≥80%)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Make gradlew executable
run: chmod +x ./gradlew
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: gradle
- name: Run unit tests with coverage
run: ./gradlew createDebugUnitTestCoverageReport
- name: Upload coverage reports
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
app/build/reports/coverage/
scanner-core/build/reports/coverage/
scanner-ui/build/reports/coverage/
scanner-rules/build/reports/coverage/
retention-days: 14
- name: Check coverage ≥ 80%
run: python3 scripts/check_coverage.py . 80 scanner-core scanner-rules