Add Codespaces configuration #336
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -Dmaven.test.skip=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 |