Skip to content

Commit

Permalink
Merge branch 'develop' into 7424-maildefinition-ng
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Oct 5, 2023
2 parents b612e1a + 7e0738e commit bc55587
Show file tree
Hide file tree
Showing 144 changed files with 7,058 additions and 3,606 deletions.
115 changes: 101 additions & 14 deletions .github/workflows/maven_unit_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Maven Unit Tests
name: Maven Tests

on:
push:
Expand Down Expand Up @@ -28,6 +28,7 @@ jobs:
continue-on-error: ${{ matrix.experimental }}
runs-on: ubuntu-latest
steps:
# Basic setup chores
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
Expand All @@ -37,16 +38,110 @@ jobs:
cache: maven

# The reason why we use "install" here is that we want the submodules to be available in the next step.
# Also, we can cache them this way for jobs triggered by this one.
- name: Build with Maven
# Also, we can cache them this way for jobs triggered by this one. We need to skip ITs here, as we run
# them in the next job - but install usually runs through verify phase.
- name: Build with Maven and run unit tests
run: >
mvn -B -f modules/dataverse-parent
-Dtarget.java.version=${{ matrix.jdk }}
-DcompilerArgument=-Xlint:unchecked -P all-unit-tests
-DskipIntegrationTests
-pl edu.harvard.iq:dataverse -am
install
- name: Maven Code Coverage
# We don't want to cache the WAR file, so delete it
- run: rm -rf ~/.m2/repository/edu/harvard/iq/dataverse

# Upload the built war file. For download, it will be wrapped in a ZIP by GitHub.
# See also https://github.com/actions/upload-artifact#zipped-artifact-downloads
- uses: actions/upload-artifact@v3
with:
name: dataverse-java${{ matrix.jdk }}.war
path: target/dataverse*.war
retention-days: 7

# Store the build for the next step (integration test) to avoid recompilation and to transfer coverage reports
- run: |
tar -cvf java-builddir.tar target
tar -cvf java-m2-selection.tar ~/.m2/repository/io/gdcc/dataverse-*
- uses: actions/upload-artifact@v3
with:
name: java-artifacts
path: |
java-builddir.tar
java-m2-selection.tar
retention-days: 3

integration-test:
runs-on: ubuntu-latest
needs: unittest
name: (${{ matrix.status}} / JDK ${{ matrix.jdk }}) Integration Tests
strategy:
fail-fast: false
matrix:
jdk: [ '17' ]
experimental: [ false ]
status: [ "Stable" ]
#
# JDK 17 builds disabled due to non-essential fails marking CI jobs as completely failed within
# Github Projects, PR lists etc. This was consensus on Slack #dv-tech. See issue #8094
# (This is a limitation of how Github is currently handling these things.)
#
#include:
# - jdk: '17'
# experimental: true
# status: "Experimental"
continue-on-error: ${{ matrix.experimental }}
steps:
# Basic setup chores
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
cache: maven

# Get the build output from the unit test job
- uses: actions/download-artifact@v3
with:
name: java-artifacts
- run: |
tar -xvf java-builddir.tar
tar -xvf java-m2-selection.tar -C /
# Run integration tests (but not unit tests again)
- run: mvn -DskipUnitTests -Dtarget.java.version=${{ matrix.jdk }} verify

# Wrap up and send to coverage job
- run: tar -cvf java-reportdir.tar target/site
- uses: actions/upload-artifact@v3
with:
name: java-reportdir
path: java-reportdir.tar
retention-days: 3

coverage-report:
runs-on: ubuntu-latest
needs: integration-test
name: Coverage Report Submission
steps:
# Basic setup chores
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
cache: maven

# Get the build output from the integration test job
- uses: actions/download-artifact@v3
with:
name: java-reportdir
- run: tar -xvf java-reportdir.tar

# Deposit Code Coverage
- name: Deposit Code Coverage
env:
CI_NAME: github
COVERALLS_SECRET: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -57,22 +152,14 @@ jobs:
-DrepoToken=${COVERALLS_SECRET} -DpullRequest=${{ github.event.number }}
jacoco:report coveralls:report
# We don't want to cache the WAR file, so delete it
- run: rm -rf ~/.m2/repository/edu/harvard/iq/dataverse
# NOTE: this may be extended with adding a report to the build output, leave a comment, send to Sonarcloud, ...

# Upload the built war file. For download, it will be wrapped in a ZIP by GitHub.
# See also https://github.com/actions/upload-artifact#zipped-artifact-downloads
- uses: actions/upload-artifact@v3
with:
name: dataverse-java${{ matrix.jdk }}.war
path: target/dataverse*.war
retention-days: 7
push-app-img:
name: Publish App Image
permissions:
contents: read
packages: write
pull-requests: write
needs: unittest
needs: integration-test
uses: ./.github/workflows/container_app_push.yml
secrets: inherit
12 changes: 7 additions & 5 deletions conf/keycloak/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ version: "3.9"
services:

keycloak:
image: 'jboss/keycloak:16.1.1'
image: 'quay.io/keycloak/keycloak:21.0'
command:
- "start-dev"
- "--import-realm"
environment:
- KEYCLOAK_USER=kcadmin
- KEYCLOAK_PASSWORD=kcpassword
- KEYCLOAK_IMPORT=/tmp/oidc-realm.json
- KEYCLOAK_ADMIN=kcadmin
- KEYCLOAK_ADMIN_PASSWORD=kcpassword
- KEYCLOAK_LOGLEVEL=DEBUG
ports:
- "8090:8080"
volumes:
- './oidc-realm.json:/tmp/oidc-realm.json'
- './test-realm.json:/opt/keycloak/data/import/test-realm.json'
2 changes: 1 addition & 1 deletion conf/keycloak/oidc-keycloak-auth-provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"factoryAlias": "oidc",
"title": "OIDC-Keycloak",
"subtitle": "OIDC-Keycloak",
"factoryData": "type: oidc | issuer: http://keycloak.mydomain.com:8090/realms/oidc-realm | clientId: oidc-client | clientSecret: ss6gE8mODCDfqesQaSG3gwUwZqZt547E",
"factoryData": "type: oidc | issuer: http://keycloak.mydomain.com:8090/realms/test | clientId: test | clientSecret: 94XHrfNRwXsjqTqApRrwWmhDLDHpIYV8",
"enabled": true
}
Loading

0 comments on commit bc55587

Please sign in to comment.