This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (58 loc) · 3.08 KB
/
java-test-coverage.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
name: java-test-coverage
on: [pull_request]
jobs:
jacoco:
runs-on: self-hosted
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: configure xml report
run: |
cd backend
echo "jacocoTestReport {reports {xml.enabled true}}" >> build.gradle
- uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
# Runs a set of commands using the runners shell
- name: Config properties file
run: |
cd backend/src/main/resources/
echo "spring.datasource.username = ${{ secrets.DB_USERNAME }}" > application.properties
echo "spring.datasource.password = ${{ secrets.DB_PWD }}" >> application.properties
echo "spring.datasource.driverClassName = org.postgresql.Driver" >> application.properties
echo "webhook.token = 123" >> application.properties
echo "domain=localhost:8080" >> application.properties
echo "reset-password.route=resetPassword" >> application.properties
echo "spring.datasource.url = ${{ secrets.DB_URL }}" >> application.properties
echo "spring.jpa.hibernate.ddl-auto = create-drop" >> application.properties
echo "baseuser.email [email protected]" > initial-user.properties
echo "baseuser.password =abcVanJe123SpringOpEnNeer" >> initial-user.properties
cd ../../test/resources/
echo "spring.datasource.username = ${{ secrets.DB_USERNAME }}" > application.properties
echo "spring.datasource.password = ${{ secrets.DB_PWD }}" >> application.properties
echo "spring.datasource.driverClassName = org.postgresql.Driver" >> application.properties
echo "webhook.token = 123" >> application.properties
echo "domain=localhost:8080" >> application.properties
echo "reset-password.route=resetPassword" >> application.properties
echo "spring.datasource.url = ${{ secrets.DB_URL }}" >> application.properties
echo "spring.jpa.hibernate.ddl-auto = create-drop" >> application.properties
echo "spring.mail.host=localhost" >> application.properties
echo "spring.mail.port=2525" >> application.properties
echo "spring.mail.username=username" >> application.properties
echo "spring.mail.password=secret" >> application.properties
echo "spring.mail.properties.mail.smtp.auth=true" >> application.properties
echo "spring.mail.properties.mail.smtp.starttls.enable=true" >> application.properties
- name: Run test coverage
run: |
cd backend/
./gradlew task test
- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/backend/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 100
min-coverage-changed-files: 100