Skip to content

Merge pull request #158 from nanotaboada/snyk-fix-dbfb2a4c6206107ce1f… #352

Merge pull request #158 from nanotaboada/snyk-fix-dbfb2a4c6206107ce1f…

Merge pull request #158 from nanotaboada/snyk-fix-dbfb2a4c6206107ce1f… #352

Workflow file for this run

# Building and testing Java with Maven
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Java CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up OpenJDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: 'maven'
- name: Compile with Maven
run: mvn compile --file pom.xml
verify:
needs: compile
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up OpenJDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: 'maven'
- name: Verify with Maven
run: mvn verify --file pom.xml
- name: Upload JaCoCo coverage report artifact
uses: actions/upload-artifact@v4
with:
name: jacoco.xml
path: ./target/site/jacoco/jacoco.xml
coverage-codecov:
needs: verify
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download JaCoCo coverage report artifact
uses: actions/download-artifact@v4
with:
name: jacoco.xml
- name: Upload JaCoCo coverage report to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: jacoco.xml
coverage-codacy:
needs: verify
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download JaCoCo coverage report artifact
uses: actions/download-artifact@v4
with:
name: jacoco.xml
- name: Upload JaCoCo coverage report to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: jacoco.xml