-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (112 loc) · 3.97 KB
/
gradle-jvm-tests.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: "JVM & JS Tests"
on:
merge_group:
pull_request:
types: [ opened, synchronize ] # Don't rerun on `edited` to save time
push:
branches: # Runs on develop to have the coverage diff on every PR
- 'develop'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_sha }}
cancel-in-progress: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
detekt:
uses: ./.github/workflows/codestyle.yml
gradle-run-tests:
needs: [detekt]
runs-on: ubuntu-22.04
# TODO: When migrating away from Cryptobox, use a regular Ubuntu machine with JDK 17 and caching
container: wirebot/cryptobox:1.4.0
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build the CLI App
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew :cli:compileKotlinJvm -Djava.library.path=$LD_LIBRARY_PATH
- name: Build the samples
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew :samples:compileKotlinJvm
- name: Build the testservice
env:
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./gradlew :testservice:compileKotlin -Djava.library.path=$LD_LIBRARY_PATH
./gradlew :testservice:test
- name: Verify DB Migrations
run: |
make db/verify-all-migrations
- name: Test with Gradle
run: |
./gradlew jvmTest koverXmlReport -Djava.library.path=$LD_LIBRARY_PATH
./gradlew jsTest
- name: Archive Test Reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: ./**/build/reports/tests/**
- name: Archive Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: ./**/build/test-results/**/*.xml
- name: Install Pip for test result publishing
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action/[email protected]
if: always()
with:
files: |
**/build/test-results/**/*.xml
- name: Upload test report to codecov
uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: "build/reports/kover/report.xml"
- name: Archive Kover report
uses: actions/upload-artifact@v4
with:
name: kover-report
path: build/reports/kover/report.xml
- name: Cleanup Gradle Cache
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
upload-test-results-datadadog:
runs-on: ubuntu-latest
needs: gradle-run-tests
if: always()
steps:
- name: Download tests results
uses: actions/[email protected]
continue-on-error: true
- name: Display structure of downloaded files
run: ls -R
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install datadog-ci
run: npm install -g @datadog/datadog-ci
- name: "Upload results"
env:
DATADOG_API_KEY: ${{ secrets.DD_API_KEY }}
DD_ENV: ci
DATADOG_SITE: datadoghq.eu
run: |
find . -name "*.xml" -type f | sed 's/ /\\ /g' | tr '\n' ' ' | xargs -L 1 datadog-ci junit upload --service kalium-jvm .