Skip to content

Commit 3b54bfb

Browse files
Anmol202005romani
authored andcommitted
Issue #127: Added pitest CI job
1 parent 0391daf commit 3b54bfb

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

.ci/print-diff-as-patch.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
set -e
3+
4+
if [ -z "$1" ]; then
5+
echo "patch file-path not provided"
6+
echo "Usage: $0 <output_file_path>"
7+
exit 1
8+
fi
9+
10+
patch_file="$1"
11+
echo "git diff > $patch_file"
12+
git diff > "$patch_file"
13+
14+
if [ ! -s "$patch_file" ]; then
15+
echo "The file '$patch_file' is empty or does not exist."
16+
exit 0
17+
else
18+
echo 'There are some diff in repository after execution.'
19+
echo 'If you are ok with diff of this run,'
20+
echo 'you will need to run the following entire multiline command:'
21+
echo "patch -p1 <<'EOF'"
22+
cat "$patch_file"
23+
echo "EOF"
24+
exit 1
25+
fi

.github/workflows/pitest.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
- name: Run Pitest with suppression check
3535
run: ./.ci/pitest.sh
3636

37+
- name: Patch command for Pitest
38+
if: failure()
39+
run: |
40+
./.ci/print-diff-as-patch.sh target/pitest.patch
41+
3742
- name: Upload Pitest Report on Failure
3843
if: failure()
3944
uses: actions/upload-artifact@v4

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@
237237
</activeRecipes>
238238
<exclusions>
239239
<exclusion>src/test/resources/**</exclusion>
240+
<exclusion>**/*.groovy</exclusion>
240241
</exclusions>
241242
</configuration>
242243
<dependencies>

0 commit comments

Comments
 (0)