@@ -10,35 +10,60 @@ permissions:
1010 contents : read
1111
1212jobs :
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-
0 commit comments