-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (114 loc) · 4.63 KB
/
Copy pathCompileAndTest.yml
File metadata and controls
118 lines (114 loc) · 4.63 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
106
107
108
109
110
111
112
113
114
115
116
117
118
# This workflow will compile and test verify
# when a push or pull request action on master is activated
# or when a push is done in a release
name: BackEnd Workflow
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
mvn_flow:
runs-on: ubuntu-latest
name: mvn flow Java 21
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: compile
run: mvn -B -f pom.xml clean compile
- name: run test suits
run: mvn -B -f pom.xml verify
- name: jacoco report
run: mvn -B -f pom.xml -Dmaven.test.skip=true package
- name: sonar cloud
env:
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_PROJECT: ${{ secrets.SONAR_PROJECT }}
run: mvn -B -f pom.xml package -Dmaven.test.skip=true org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.java.source=21 -Dsonar.java.target=21 -Dsonar.token=$SONAR_TOKEN -Dsonar.host.url=https://sonarcloud.io/ -Dsonar.organization=$SONAR_ORGANIZATION -Dorganization=$SONAR_ORGANIZATION -Dsonar.projectKey=natural-deduction
- name: set PR number
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
run: |
mkdir jacoco-natural-deduction/target/tmp
mv -v jacoco-natural-deduction/target/site/* jacoco-natural-deduction/target/tmp/
mkdir jacoco-natural-deduction/target/site/$PR
mv -v jacoco-natural-deduction/target/tmp/* jacoco-natural-deduction/target/site/$PR/
env:
PR: ${{ github.event.pull_request.number }}
- name: publish jacoco report
uses: peaceiris/actions-gh-pages@v4.0.0
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
env:
PR: ${{ github.event.pull_request.number }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./jacoco-natural-deduction/target/site/
user_name: 'jacoco-report[bot]'
user_email: 'jacoco-report[bot]@users.noreply.github.com'
commit_message: "jacoco-report for PR ${PR}"
keep_files: true
- name: publish jacoco report
uses: peaceiris/actions-gh-pages@v4.0.0
if: github.event_name != 'pull_request' && github.actor != 'dependabot[bot]'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./jacoco-natural-deduction/target/site/
user_name: 'jacoco-report[bot]'
user_email: 'jacoco-report[bot]@users.noreply.github.com'
commit_message: 'jacoco-report'
keep_files: true
mutation_testing:
runs-on: ubuntu-latest
name: Mutation Testing
steps:
- uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'corretto'
- name: mutation testing
run: |
mvn -B -f pom.xml clean test-compile org.pitest:pitest-maven:mutationCoverage org.pitest:pitest-maven:report-aggregate-module
mkdir -p target/site
mv target/pit-reports target/site
- name: set PR number
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
run: |
mkdir -p target/tmp
mv -v target/site/* target/tmp
mkdir -p target/site/$PR
mv -v target/tmp/* target/site/$PR
env:
PR: ${{ github.event.pull_request.number }}
- name: publish pitest report
uses: peaceiris/actions-gh-pages@v4.0.0
if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'
env:
PR: ${{ github.event.pull_request.number }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site/
user_name: 'pitest-report[bot]'
user_email: 'pitest-report[bot]@users.noreply.github.com'
commit_message: "pitest-report for PR $PR"
keep_files: true
- name: publish pitest report
uses: peaceiris/actions-gh-pages@v4.0.0
if: github.event_name != 'pull_request' && github.actor != 'dependabot[bot]'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/site/
user_name: 'pitest-report[bot]'
user_email: 'pitest-report[bot]@users.noreply.github.com'
commit_message: 'pitest-report'
keep_files: true