Merge pull request #420 from AAFC-BICoE/32288_Patch_Crnk_CrnkErrorCon… #297
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] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
- name: Setup Graphviz | |
uses: ts-graphviz/setup-graphviz@v1 | |
- name: Build with Maven | |
run: mvn -B install | |
- name: Run Checkstyle | |
run: mvn checkstyle:check | |
- name: Run SpotBugs | |
run: mvn spotbugs:check | |
- name: Check Test Coverage (JaCoCo) | |
run: mvn -pl dina-base-api jacoco:check | |
- name: Run OWASP dependency-check (only on dev) | |
run: mvn org.owasp:dependency-check-maven:check | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
- name: Set up for Maven Central deploy (master branch only) | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: actions/setup-java@v3 | |
with: # running setup-java again overwrites the settings.xml | |
distribution: 'temurin' | |
java-version: '17' | |
cache: 'maven' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_CENTRAL_PW | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Publish to Maven Central (master branch only) | |
run: mvn -DsignArtifacts=true --batch-mode javadoc:jar deploy | |
if: ${{ github.ref == 'refs/heads/master' }} | |
env: | |
MAVEN_USERNAME: aafcbicoe | |
MAVEN_CENTRAL_PW: ${{ secrets.MAVEN_CENTRAL_PW }} | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | |
- name: Deploy GitHub Pages (master branch only) | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: target/generated-docs |