Skip to content

Commit d3b838f

Browse files
Flossyclaude
andcommitted
Improve GitHub Actions workflow
- Upgrade actions/checkout from v2 to v4 - Upgrade gha-git-credentials from @latest to v0.4 - Add Maven dependency caching for faster builds - Add 30-minute timeout to prevent hanging builds - Add concurrency control to prevent simultaneous builds - Add explicit permissions block (least privilege) - Add test report publishing - Fix typo: "latests depenendencies" → "latest dependencies" Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ec68969 commit d3b838f

1 file changed

Lines changed: 27 additions & 7 deletions

File tree

.github/workflows/main.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,36 @@ on:
44
push:
55
branches: [ main ]
66

7+
# Prevent concurrent builds
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: false
11+
12+
permissions:
13+
contents: write
14+
packages: write
15+
716
jobs:
817
build:
918
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.event.pusher.email != 'version-bump@flossware.org'
1019
runs-on: ubuntu-latest
20+
timeout-minutes: 30
1121

1222
steps:
1323
- name: Updating runner
1424
run: sudo apt-get update
1525

26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
1631
- name: Setup JDK 17
1732
uses: actions/setup-java@v4
1833
with:
1934
distribution: 'temurin'
2035
java-version: '17'
21-
22-
- name: Checkout
23-
uses: actions/checkout@v2
36+
cache: 'maven'
2437

2538
- name: Preparing settings.xml
2639
uses: s4u/maven-settings-action@v3.0.0
@@ -42,7 +55,7 @@ jobs:
4255
]
4356
4457
- name: Setup .gitconfig for version bumps
45-
uses: oleksiyrudenko/gha-git-credentials@latest
58+
uses: oleksiyrudenko/gha-git-credentials@v0.4
4659
with:
4760
global: true
4861
name: 'Version Bump'
@@ -53,14 +66,21 @@ jobs:
5366
- name: Incrementing pom.xml version
5467
run: "mvn -U build-helper:parse-version versions:set -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.nextMinorVersion} versions:commit"
5568

56-
- name: Ensure latests depenendencies in pom.xml
69+
- name: Ensure latest dependencies in pom.xml
5770
run: "mvn -Dincludes='org.apache.commons:*, org.apache.cxf:*, org.junit.jupiter:*' -DgenerateBackupPoms=false versions:update-properties"
5871

59-
- name: Building
72+
- name: Building and testing
6073
run: "mvn -U clean install"
6174

75+
- name: Publish Test Report
76+
uses: mikepenz/action-junit-report@v4
77+
if: always()
78+
with:
79+
report_paths: '**/target/surefire-reports/TEST-*.xml'
80+
check_name: Test Results
81+
6282
- name: Deploy to packagecloud.io
6383
run: "mvn -DskipTests deploy"
6484

6585
- name: Checkin and tag to github
66-
run: "mvn scm:checkin scm:tag"
86+
run: "mvn scm:checkin scm:tag"

0 commit comments

Comments
 (0)