Skip to content

Commit 074845d

Browse files
committed
Build maven only when changes are outside site
1 parent bbd397d commit 074845d

4 files changed

Lines changed: 50 additions & 11 deletions

File tree

.DS_Store

-6 KB
Binary file not shown.

.github/workflows/pr.yml

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,35 +10,60 @@ permissions:
1010
contents: read
1111

1212
jobs:
13-
build:
13+
maven:
1414
runs-on: ubuntu-latest
15-
15+
if: github.event_name == 'push' || github.event_name == 'pull_request'
1616
steps:
1717
- uses: actions/checkout@v4
18-
19-
- name: Setup PHP Action
20-
uses: shivammathur/setup-php@2.24.0
2118
with:
22-
php-version: '5.6'
23-
tools: composer
19+
fetch-depth: 2
2420

25-
- name: Prepare upload
26-
run: ./prepare-upload.sh
21+
- name: Check for non-site changes
22+
id: filter
23+
run: |
24+
if [ "${{ github.event_name }}" = "pull_request" ]; then
25+
BASE=${{ github.event.pull_request.base.sha }}
26+
HEAD=${{ github.event.pull_request.head.sha }}
27+
else
28+
BASE=${{ github.event.before }}
29+
HEAD=${{ github.sha }}
30+
fi
31+
CHANGED=$(git diff --name-only "$BASE" "$HEAD" -- . ':!site/' ':!examples/' | head -1)
32+
if [ -n "$CHANGED" ]; then
33+
echo "run=true" >> "$GITHUB_OUTPUT"
34+
else
35+
echo "run=false" >> "$GITHUB_OUTPUT"
36+
fi
2737
2838
- uses: actions/setup-java@v4
39+
if: steps.filter.outputs.run == 'true'
2940
with:
3041
distribution: temurin
3142
java-version: '11'
3243
cache: maven
3344

3445
- name: Maven tests
46+
if: steps.filter.outputs.run == 'true'
3547
run: mvn -T 1C -Djava.awt.headless=true -Dmaven.test.redirectTestOutputToFile=true --fail-at-end --batch-mode org.jacoco:jacoco-maven-plugin:prepare-agent test org.jacoco:jacoco-maven-plugin:report install
36-
# working-directory: ./plugins/dummy
3748

3849
- name: Codecov
50+
if: steps.filter.outputs.run == 'true'
3951
uses: codecov/codecov-action@v5
4052

53+
site:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v4
57+
58+
- name: Setup PHP Action
59+
uses: shivammathur/setup-php@2.24.0
60+
with:
61+
php-version: '5.6'
62+
tools: composer
63+
64+
- name: Prepare upload
65+
run: ./prepare-upload.sh
66+
4167
- name: Perform upload
4268
run: 'curl --fail -vk https://jmeter-plugins.org/unzip.php -F "zipfile=@upload/site.zip" -H "Authorization: Bearer ${{ secrets.UPLOAD_TOKEN }}"'
4369
if: github.ref == 'refs/heads/master'
44-

graphs/graphs-dist/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,20 @@
3131
</developer>
3232
</developers>
3333

34+
<build>
35+
<plugins>
36+
<plugin>
37+
<groupId>org.sonatype.central</groupId>
38+
<artifactId>central-publishing-maven-plugin</artifactId>
39+
<version>0.7.0</version>
40+
<extensions>true</extensions>
41+
<configuration>
42+
<publishingServerId>central</publishingServerId>
43+
<autoPublish>true</autoPublish>
44+
</configuration>
45+
</plugin>
46+
</plugins>
47+
</build>
3448
<properties>
3549
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3650
<maven.compiler.source>1.8</maven.compiler.source>

plugins/.DS_Store

-8 KB
Binary file not shown.

0 commit comments

Comments
 (0)