-
Notifications
You must be signed in to change notification settings - Fork 235
83 lines (74 loc) · 2.37 KB
/
pr.yml
File metadata and controls
83 lines (74 loc) · 2.37 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
name: Verify Pull Request
env:
MAVEN_ARGS: -V -ntp -e
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
on:
pull_request:
paths-ignore:
- 'docs/**'
- 'adr/**'
workflow_dispatch:
jobs:
check_format_and_unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Java and Maven
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
cache: 'maven'
- name: Check code format
run: |
./mvnw ${MAVEN_ARGS} spotless:check --file pom.xml
./mvnw -N license:check --file pom.xml
- name: Run unit tests
run: ./mvnw ${MAVEN_ARGS} clean install -Pno-apt --file pom.xml
build:
uses: ./.github/workflows/build.yml
performance_report:
name: Post Performance Results
runs-on: ubuntu-latest
needs: build
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v6
- name: Download all performance artifacts
uses: actions/download-artifact@v7
with:
pattern: performance-results-run-${{ github.run_id }}*
path: performance-results
merge-multiple: false
- name: Check for performance results
id: check_results
run: |
if [ -d "performance-results" ] && [ "$(ls -A performance-results/*.json 2>/dev/null)" ]; then
echo "Has results"
echo "has_results=true" >> $GITHUB_OUTPUT
else
echo "Has NO results"
echo "has_results=false" >> $GITHUB_OUTPUT
fi
- name: Convert performance results to markdown
if: steps.check_results.outputs.has_results == 'true'
id: convert
run: |
echo "# Performance Test Results" > comment.md
echo "" >> comment.md
for file in performance-results/*.json; do
if [ -f "$file" ]; then
echo "Processing $file"
python3 .github/scripts/performance-to-markdown.py "$file" >> comment.md
echo "" >> comment.md
fi
done
- name: Post PR comment
if: steps.check_results.outputs.has_results == 'true' && github.event_name == 'pull_request'
uses: marocchino/sticky-pull-request-comment@v2
with:
path: comment.md
recreate: true