Skip to content

Merge pull request #346 from pkiraly/snyk-upgrade-7cfb8ad4414fd4c4e24… #845

Merge pull request #346 from pkiraly/snyk-upgrade-7cfb8ad4414fd4c4e24…

Merge pull request #346 from pkiraly/snyk-upgrade-7cfb8ad4414fd4c4e24… #845

Workflow file for this run

# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Java CI with Maven
on:
push:
branches: [ main, develop, issue-75-british-library, 140-pica-parsing-pica-record ]
pull_request:
branches: [ main, develop, issue-75-british-library, 140-pica-parsing-pica-record ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze with Sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -DskipGpg=true
# coverage report: https://app.codecov.io/gh/pkiraly/metadata-qa-marc
- name: Pubish code coverage at codecov.io
uses: codecov/codecov-action@v3
with:
file: ./**/target/site/jacoco/jacoco.xml
name: codecov
# COVERALL_REPO_TOKEN is available as the TOKEN variable at https://coveralls.io/github/pkiraly/metadata-qa-marc
# coverage report: https://coveralls.io/github/pkiraly/metadata-qa-marc
- name: Coveralls Coverage Report Submission
run: mvn coveralls:report -DrepoToken=${{ secrets.COVERALL_REPO_TOKEN }}