Bump org.jacoco:jacoco-maven-plugin from 0.8.10 to 0.8.11 #804
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
pull_request: | |
branches: | |
- develop | |
- main | |
jobs: | |
code-formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
- name: Cache Maven | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Check formatting | |
run: ./mvnw formatter:validate --no-transfer-progress | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
java: [8.x, 11.x, 17.x, 21.x] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up Java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: ${{ matrix.java }} | |
- name: Cache Maven | |
uses: actions/cache@v1 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Unit Tests | |
if: (github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/main') || !startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/jdk/8') | |
run: ./mvnw -V test --no-transfer-progress | |
- name: Unit Tests with Coverage | |
if: (github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main') && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/jdk/8') | |
run: | | |
./mvnw -V jacoco:prepare-agent test jacoco:report --no-transfer-progress | |
- name: Deploy to sonatype-snapshots | |
if: github.ref == 'refs/heads/develop' && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/jdk/8') | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
run: | | |
set -e | |
cat > settings.xml <<EOF | |
<settings> | |
<servers> | |
<server> | |
<id>sonatype-snapshots</id> | |
<username>${SONATYPE_USERNAME}</username> | |
<password>${SONATYPE_PASSWORD}</password> | |
</server> | |
</servers> | |
</settings> | |
EOF | |
CURRENT_VERSION=$(grep '<version>' pom.xml | head -n 1 | sed -e 's|<version>||g' -e 's|</version>||g' | xargs echo) | |
if [ "${CURRENT_VERSION}" = "$(echo ${CURRENT_VERSION} | grep "\-SNAPSHOT")" ];then | |
./mvnw -V deploy -s settings.xml -DskipTests=true -DserverId=sonatype-snapshots --no-transfer-progress | |
fi | |
- name: Deploy to sonatype-releases | |
if: github.ref == 'refs/heads/main' && startsWith(env.JAVA_HOME, '/opt/hostedtoolcache/jdk/8') | |
env: | |
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} | |
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} | |
GPG_KEYNAME: ${{ secrets.GPG_KEYNAME }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
ENCRYPTION_PASSWORD: ${{ secrets.ENCRYPTION_PASSWORD }} | |
run: | | |
set -e | |
docker run \ | |
--rm \ | |
-e SONATYPE_USERNAME=${SONATYPE_USERNAME} \ | |
-e SONATYPE_PASSWORD=${SONATYPE_PASSWORD} \ | |
-e GPG_KEYNAME=${GPG_KEYNAME} \ | |
-e GPG_PASSPHRASE=${GPG_PASSPHRASE} \ | |
-e ENCRYPTION_PASSWORD=${ENCRYPTION_PASSWORD} \ | |
-v ~/.m2:/root/.m2 \ | |
-v "$PWD":/workspace \ | |
-w /workspace \ | |
making/deploy-sonatype |