This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Improves POM Scanner #127
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: Java CI | |
on: | |
push: | |
branches-ignore: | |
- 'master' | |
env: | |
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
platform: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.platform }} | |
environment: | |
name: default | |
env: | |
ARTIFACTORY_USERNAME_REF: "${{ secrets.ARTIFACTORY_USERNAME_REF }}" | |
ARTIFACTORY_TOKEN_REF: "${{ secrets.ARTIFACTORY_TOKEN_REF }}" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '8' | |
distribution: 'temurin' | |
cache: maven | |
server-id: pixee | |
server-username: ARTIFACTORY_USERNAME_REF | |
server-password: ARTIFACTORY_TOKEN_REF | |
- name: Set up Maven | |
uses: stCarolas/[email protected] | |
with: | |
maven-version: 3.8.2 | |
- name: Resolve all Dependencies | |
run: | | |
mvn -N -B dependency:go-offline | |
- name: Build with Maven | |
run: | | |
mvn -N -B install | |
- name: Integration Testing (Linux Only) | |
if: matrix.platform == 'ubuntu-latest' | |
run: | | |
mvn -N -B -Dmaven.test.skip install | |
mvn -N -B -P integration-testing verify | |
- name: Generate Coverage Badge | |
id: jacoco | |
uses: cicirello/jacoco-badge-generator@v2 | |
if: ${{ matrix.platform == 'ubuntu-latest' }} | |
with: | |
generate-branches-badge: true | |
- name: Log coverage percentage | |
if: ${{ matrix.platform == 'ubuntu-latest' }} | |
run: | | |
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | |
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | |
- # When using "Act", disable certain actions, starting with this one | |
# See https://github.com/nektos/act#skipping-steps for more details | |
name: Commit the JaCoCo badge (if it changed) | |
if: ${{ matrix.platform == 'ubuntu-latest' && !env.ACT }} | |
run: | | |
if [[ `git status --porcelain` ]]; then | |
git config --global user.name 'Jacoco Coverage Update Action' | |
git config --global user.email '[email protected]' | |
git add -A | |
git commit -m "[no ci] Autogenerated JaCoCo coverage badge" | |
git push | |
fi | |
- name: Upload JaCoCo coverage report | |
if: ${{ matrix.platform == 'ubuntu-latest' && !env.ACT }} | |
uses: actions/upload-artifact@v2 | |
with: | |
name: jacoco-report | |
path: target/site/jacoco/ | |
- name: Deploy (only if on master) | |
if: ${{ github.ref_name == 'master' && matrix.platform == 'ubuntu-latest' && !env.ACT }} | |
run: | | |
mvn -N -B deploy -DaltDeploymentRepository=pixee::default::https://pixee.jfrog.io/artifactory/mailman-libs-snapshot |