Build Girders #737
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
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created | |
# See: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path | |
name: Build Girders | |
on: | |
schedule: | |
# schedule multiple times because GitHub does not guarantee a scheduled job to run: | |
# https://github.community/t/no-assurance-on-scheduled-jobs/133753/2 | |
- cron: '0 0,1,2,3 * * 5' | |
push: | |
create: | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
build_girders: | |
name: build girders | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17.0.0' | |
distribution: 'zulu' | |
cache: 'maven' | |
server-id: 'ossrh' # Value of the distributionManagement/repository/id field of the pom.xml | |
server-username: MAVEN_USERNAME # same name as below env variable | |
server-password: MAVEN_PASSWORD # same name as below env variable | |
gpg-private-key: ${{ secrets.PGP_PRIVATE_KEY }} | |
gpg-passphrase: GPG_PASSPHRASE # same name as below env variable | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: build girders | |
run: | | |
mvn --batch-mode clean | |
mvn --batch-mode -Ppedantic deploy | |
shell: bash | |
env: | |
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} | |
GPG_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} | |
- name: upload surefire report | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: surefire-reports | |
path: girders-demos/girders-demo-test/target/surefire-reports/ | |
- name: Build and analyze | |
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 -Dsonar.projectKey=girders-java | |
integration_tests_21: | |
name: Integration tests for Java 21 | |
runs-on: ubuntu-latest | |
needs: build_girders | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '21.0.0' | |
distribution: 'zulu' | |
cache: 'maven' | |
- name: run integration tests | |
run: mvn --batch-mode -f girders-demos/girders-demo-test/pom.xml install | |
integration_tests_17: | |
name: Integration tests for Java 17 | |
runs-on: ubuntu-latest | |
needs: build_girders | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17.0.0' | |
distribution: 'zulu' | |
cache: 'maven' | |
- name: run integration tests | |
run: mvn --batch-mode -f girders-demos/girders-demo-test/pom.xml install | |