Skip to content

Commit f9382a3

Browse files
authored
Merge pull request #6 from Optum/buildtest
Copy and edit from sourcehawk to see what happens
2 parents 4d82127 + 40e871d commit f9382a3

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

.github/workflows/maven-ci.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Maven CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'releases/[1-9]+.[0-9]+.x'
8+
paths-ignore:
9+
- '.github/**'
10+
- '.gitignore'
11+
- 'attribute.txt'
12+
- 'CODE_OF_CONDUCT.md'
13+
- 'CONTRIBUTING.md'
14+
- 'INDIVIDUAL_CONTRIBUTOR_LICENSE.md'
15+
- 'LICENSE'
16+
- 'NOTICE.txt'
17+
- '**/README.md'
18+
pull_request:
19+
branches:
20+
- 'main'
21+
- 'releases/[1-9]+.[0-9]+.x'
22+
paths-ignore:
23+
- '.github/**'
24+
- '.gitignore'
25+
- 'attribute.txt'
26+
- 'CODE_OF_CONDUCT.md'
27+
- 'CONTRIBUTING.md'
28+
- 'INDIVIDUAL_CONTRIBUTOR_LICENSE.md'
29+
- 'LICENSE'
30+
- 'NOTICE.txt'
31+
- '**/README.md'
32+
33+
env:
34+
PRIMARY_JAVA_VERSION: '11'
35+
36+
jobs:
37+
38+
build:
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
java: ['11', '17']
43+
name: Build Java - ${{ matrix.java }}
44+
steps:
45+
- name: Checkout Source Code
46+
uses: actions/checkout@v2
47+
- name: Maven Prepare
48+
id: maven-prepare
49+
uses: optum/sourcehawk/.github/actions/maven-prepare@main
50+
with:
51+
cache-key-suffix: build-java
52+
java-version: ${{ matrix.java }}
53+
gpg-private-key: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }}
54+
- name: Build Maven Project
55+
if: success() && (github.event_name == 'pull_request' || (github.event_name == 'push' && matrix.java != env.PRIMARY_JAVA_VERSION))
56+
run: ./mvnw -B -U -D ci.build install
57+
- name: Build Maven Project and Deploy Snapshots to Sonatype OSSRH
58+
if: success() && (github.event_name == 'push' && matrix.java == env.PRIMARY_JAVA_VERSION)
59+
run: ./mvnw -B -U -D ci.build -D ci.deploy -D ci.snapshot deploy
60+
env:
61+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
62+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
63+
SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
64+
- name: Publish Test Report
65+
if: always()
66+
continue-on-error: true
67+
uses: dorny/test-reporter@v1
68+
with:
69+
name: Test Report - Java ${{ matrix.java }}
70+
path: '**/target/(surefire|failsafe)-reports/TEST-*.xml'
71+
reporter: java-junit

0 commit comments

Comments
 (0)