-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (85 loc) · 2.73 KB
/
tests.yaml
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
name: Run Tests
on:
push:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
env:
PRIVATE_MVN_REGISTRY_TOKEN: ${{ secrets.GITLAB_PKG_REGISTRY_TOKEN }}
PRIVATE_MVN_REGISTRY_URL: ${{ secrets.GITLAB_MAVEN_REGISTRY_URL }}
PRIVATE_MVN_REGISTRY_USER: ${{ secrets.PRIVATE_MVN_REGISTRY_USER }}
PRIVATE_MVN_REGISTRY_PASS: ${{ secrets.PRIVATE_MVN_REGISTRY_PASS }}
jobs:
test:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK 18
uses: actions/setup-java@v3
with:
java-version: "18"
distribution: "temurin"
cache: maven
- name: Setup depends
run: |
pip install yq
- name: Setup maven settings.xml
run: |
envsubst < ./.m2/settings.default.xml.tpl > ./.m2/settings.xml
- name: Check Formatting
run: |
mvn spotless:check
- name: Build
run: |
mvn --batch-mode --update-snapshots clean package -DskipTests
- name: Test
run: |
mvn --batch-mode --update-snapshots test
- name: Generate JaCoCo Badge
uses: cicirello/jacoco-badge-generator@v2
with:
generate-branches-badge: true
generate-summary: true
badges-directory: build/reports/jacoco/test/html/badges
- name: Log coverage percentage
run: |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}"
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}"
- name: Publish coverage report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: build/reports/jacoco/test/html
mutation-test:
needs: test
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup JDK 18
uses: actions/setup-java@v3
with:
java-version: "18"
distribution: "temurin"
cache: maven
- name: Setup depends
run: |
pip install yq
- name: Setup maven settings.xml
run: |
envsubst < ./.m2/settings.default.xml.tpl > ./.m2/settings.xml
- name: Build
run: |
mvn --batch-mode --update-snapshots clean package -DskipTests
- name: Test
run: |
mvn test-compile org.pitest:pitest-maven:mutationCoverage -DmutationThreshold=57
- name: Publish mutation test report to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: github.ref == 'refs/heads/main'
with:
BRANCH: gh-pages
folder: target/pit-reports/
target-folder: mutation-report/