-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (77 loc) · 2.38 KB
/
ci.yml
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
name: Continuous Integration
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
env:
MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=25 -Dmaven.wagon.http.retryHandler.count=3
jobs:
build:
strategy:
fail-fast: false
matrix:
java: [ 17, 19 ]
websphere: [ "8.5.5.22", "9.0.5.12" ]
name: "Java ${{ matrix.java }} - WebSphere ${{ matrix.websphere }}"
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Maven Repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-java-${{ matrix.java }}-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-java-${{ matrix.java }}-
maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- name: Build
env:
WEBSPHERE_VERSION: ${{ matrix.websphere }}
run: mvn -B -e -Prelease -Dgpg.skip=true verify
- name: Upload Coverage Report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
files: ./target/coverage.json
token: ${{ secrets.CODECOV_TOKEN }}
- name: Remove Snapshots
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Deploy
runs-on: ubuntu-22.04
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Maven Repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: maven-deploy-${{ hashFiles('**/pom.xml') }}
restore-keys: |
maven-deploy-
maven-
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
server-id: ossrh
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
- name: Deploy
# Can't activate the release profile here because github-release-plugin can't be easily skipped
run: mvn -B -e -DskipTests=true deploy
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
- name: Remove Snapshots
run: find ~/.m2/repository -name '*-SNAPSHOT' -a -type d -print0 | xargs -0 rm -rf