Skip to content

Commit

Permalink
Merge pull request #6 from Optum/buildtest
Browse files Browse the repository at this point in the history
Copy and edit from sourcehawk to see what happens
  • Loading branch information
JohnMThayer authored Sep 11, 2024
2 parents 4d82127 + 40e871d commit f9382a3
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/maven-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Maven CI

on:
push:
branches:
- 'main'
- 'releases/[1-9]+.[0-9]+.x'
paths-ignore:
- '.github/**'
- '.gitignore'
- 'attribute.txt'
- 'CODE_OF_CONDUCT.md'
- 'CONTRIBUTING.md'
- 'INDIVIDUAL_CONTRIBUTOR_LICENSE.md'
- 'LICENSE'
- 'NOTICE.txt'
- '**/README.md'
pull_request:
branches:
- 'main'
- 'releases/[1-9]+.[0-9]+.x'
paths-ignore:
- '.github/**'
- '.gitignore'
- 'attribute.txt'
- 'CODE_OF_CONDUCT.md'
- 'CONTRIBUTING.md'
- 'INDIVIDUAL_CONTRIBUTOR_LICENSE.md'
- 'LICENSE'
- 'NOTICE.txt'
- '**/README.md'

env:
PRIMARY_JAVA_VERSION: '11'

jobs:

build:
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '17']
name: Build Java - ${{ matrix.java }}
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Maven Prepare
id: maven-prepare
uses: optum/sourcehawk/.github/actions/maven-prepare@main
with:
cache-key-suffix: build-java
java-version: ${{ matrix.java }}
gpg-private-key: ${{ secrets.SONATYPE_GPG_PRIVATE_KEY }}
- name: Build Maven Project
if: success() && (github.event_name == 'pull_request' || (github.event_name == 'push' && matrix.java != env.PRIMARY_JAVA_VERSION))
run: ./mvnw -B -U -D ci.build install
- name: Build Maven Project and Deploy Snapshots to Sonatype OSSRH
if: success() && (github.event_name == 'push' && matrix.java == env.PRIMARY_JAVA_VERSION)
run: ./mvnw -B -U -D ci.build -D ci.deploy -D ci.snapshot deploy
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
- name: Publish Test Report
if: always()
continue-on-error: true
uses: dorny/test-reporter@v1
with:
name: Test Report - Java ${{ matrix.java }}
path: '**/target/(surefire|failsafe)-reports/TEST-*.xml'
reporter: java-junit

0 comments on commit f9382a3

Please sign in to comment.