-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (86 loc) · 3.13 KB
/
testReportJob.yml
File metadata and controls
105 lines (86 loc) · 3.13 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
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
name: Send Report to Project
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
unitTests:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- run: |
echo "${{ secrets.KEYSTORE }}" > keystore.jks.asc
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSPHRASE }}" --batch keystore.jks.asc > keystore.jks
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Gradle Wrapper Validation
uses: gradle/wrapper-validation-action@v3
- name: Cache Gradle
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
~/gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.toml') }}
restore-keys: |
${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'gradle/wrapper/gradle-wrapper.properties', 'gradle/libs.versions.toml') }}
${{ runner.os }}-gradle-
${{ runner.os }}-
- name: Configure Keystore
env:
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
run: |
echo "storeFile=keystore.jks" >> keystore.properties
echo "keyAlias=$KEYSTORE_KEY_ALIAS" >> keystore.properties
echo "storePassword=$KEYSTORE_STORE_PASSWORD" >> keystore.properties
echo "keyPassword=$KEYSTORE_KEY_PASSWORD" >> keystore.properties
- name: Build application
run: ./gradlew koverHtmlReport --full-stacktrace
- name: Check report files
run: |
ls app/build/reports/kover/html
- name: Archive code coverage results
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: app/build/reports/kover/html
saveReport:
name: SaveReport
runs-on: ubuntu-latest
needs: [ unitTests ]
steps:
- name: Checkout branch
uses: actions/checkout@v3
- name: Create local changes
run: |
rm -rf docs/reports
mkdir docs/reports
- name: Download report
uses: actions/download-artifact@v4
with:
name: code-coverage-report
path: docs/reports
- name: Check report files
run: |
ls docs/reports
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add docs/reports
git commit -m "Add changes" -a
- name: Push changd
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PUSH_TOKEN }}
branch: ${{ github.ref }}