-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkafka-publish-task-pull-request.yml
More file actions
58 lines (48 loc) · 1.8 KB
/
kafka-publish-task-pull-request.yml
File metadata and controls
58 lines (48 loc) · 1.8 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
name: 'Check Pull Request for plugin: kafka-publish-task-plugin'
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'kap/**'
jobs:
tests:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21 for x64
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
architecture: x64
- name: Start Kafka
working-directory: kap/src/test/resources
run: |
docker compose up -d
timeout 60 bash -c 'until docker compose exec kafka \
/opt/kafka/bin/kafka-broker-api-versions.sh \
--bootstrap-server localhost:9092 > /dev/null 2>&1; do sleep 2; done'
- name: Install Pandoc
run: sudo apt-get update && sudo apt-get install -y pandoc
- name: Execute unit tests
run: mvn -ntp -pl kap test
- name: Stop Kafka
if: always()
working-directory: kap/src/test/resources
run: docker compose down
- name: Execute mutation tests
run: mvn -ntp -pl kap org.pitest:pitest-maven:mutationCoverage
- name: Extract summary from pitest
run: |
echo "<html><head></head><body><h1>Pit Test Coverage Report: kafka-publish-task-plugin</h1><h3>Project Summary</h3>" > pitest.html
perl -0777 -ne 'print "$1\n" if /(<table>.*?<\/table>)/s' kap/target/pit-reports/index.html >> pitest.html
echo "</body></html>" >> pitest.html
- name: Convert pitest report to markdown
run: pandoc --from html --to markdown_github --no-highlight pitest.html
- name: Post comment
uses: luukkemp/pr-comment@2024.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: pitest.html