Skip to content

Update build.yml

Update build.yml #47

Workflow file for this run

name: build
on: [push]
jobs:
build:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
java-version: [17, 21]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: ${{ matrix.java-version }}
- run: mvn -B install --no-transfer-progress
coverage:
if: "!contains(github.event.head_commit.message, 'skip ci')"
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- run: mvn -B verify -P coverage --no-transfer-progress
- uses: codecov/codecov-action@v3
with:
file: ./**/target/site/jacoco/jacoco.xml
name: codecov
publish-snapshot:
if: "!contains(github.event.head_commit.message, 'skip ci')"
needs: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up settings.xml for GitHub Packages
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 17
- name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded)
run: mvn -B --no-transfer-progress deploy -P github -DskipTests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}