forked from assertj/assertj
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.67 KB
/
pitest-receive-pr.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
#
# Part one of two stage process to update PRs with pitest data when accepting PRs from untrusted forks.
#
# The jobs will run the mutation analysis, but the token supplied by gtihub does not have write access.
# The results are therefore stored as an artifact which will be used to update the PR in the second stage.
#
# Projects where PRs come from the same repo can use a simpler single stage process.
#
# see https://blog.pitest.org/pitest-pr-setup/
#
name: Receive
# read-only repo token
# no access to secrets
on:
pull_request:
jobs:
store-pitest-feedback:
# Only run on forked repos.
if: github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
with:
# important to set a fetch depth of 2. By default the checkout action make no history available
fetch-depth: 2
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 11
cache: 'maven'
- name: run pitest
# pitest has been bound to a profile called pitest for normal running
# we add config to analyse only changes made within a PR and treat surviving mutants as check errors
# failWhenNoMutations is unset in the pom, as otherwise PRs that do not affect java code would fail
run: mvn -e -B -Ppitest -Dfeatures="+GIT(from[HEAD~1]), +gitci" test
- name: aggregate files
run: mvn -e -B -Ppitest pitest-git:aggregate
- name: upload results
uses: actions/upload-artifact@v2
with:
name: pitest
path: target/pit-reports-ci/