Skip to content

Commit

Permalink
[CI] Update build-snapshot-worker.yml for separate database tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
corneil committed Aug 8, 2024
1 parent b68e7cb commit c0462f2
Showing 1 changed file with 70 additions and 2 deletions.
72 changes: 70 additions & 2 deletions .github/workflows/build-snapshot-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,75 @@ jobs:
BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildname: ${{ env.BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildname }}
BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildnumber: ${{ env.BUILD_ZOO_HANDLER_spring_cloud_dataflow_buildnumber }}
BUILD_ZOO_HANDLER_spring_cloud_skipper_version: ${{ env.BUILD_ZOO_HANDLER_spring_cloud_skipper_version }}

database-tests:
if: github.repository_owner == 'spring-cloud'
runs-on: ubuntu-latest
strategy:
matrix:
db: [ 'ORACLE', 'DB2' ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2-${{ matrix.db }}
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'liberica'
- uses: jvalkeal/setup-maven@v1
with:
maven-version: 3.8.8
maven-mirror: 'https://dlcdn.apache.org/maven/maven-3/'
- uses: jfrog/setup-jfrog-cli@v1
with:
version: 1.46.4
env:
JF_ARTIFACTORY_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Login dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Configure JFrog Cli
run: |
jfrog rt mvnc \
--server-id-resolve=repo.spring.io \
--server-id-deploy=repo.spring.io \
--repo-resolve-releases=libs-milestone \
--repo-resolve-snapshots=libs-snapshot \
--repo-deploy-releases=libs-release-local \
--repo-deploy-snapshots=libs-snapshot-local
- uses: ./.github/actions/install-xmlutils
- name: Test
shell: bash
timeout-minutes: 75
run: |
jfrog rt mvn clean install -s .settings.xml -DskipTests -am -pl :spring-cloud-dataflow-server,:spring-cloud-skipper-server
export ENABLE_${{ matrix.db }}=true
jfrog rt mvn test -s .settings.xml -pl :spring-cloud-dataflow-server,:spring-cloud-skipper-server -Dgroups=${{ matrix.db }}
- name: Test Report
uses: dorny/test-reporter@v1
if: ${{ success() || failure() }}
with:
name: Unit Tests
path: '**/surefire-reports/*.xml'
reporter: java-junit
list-tests: failed
- name: Capture Test Results
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: test-results
path: '**/target/surefire-reports/**/*.*'
retention-days: 7
if-no-files-found: ignore
# clean m2 cache
- name: Clean cache
run: |
find ~/.m2/repository -type d -name '*SNAPSHOT' | xargs rm -fr
images:
name: Build and Publish Images
needs: [ build ]
Expand All @@ -113,7 +181,7 @@ jobs:
GCR_JSON_KEY: ${{ secrets.GCR_JSON_KEY }}

wrap:
needs: [ build, images ]
needs: [ build, images, database-tests ]
runs-on: ubuntu-latest
steps:
- name: Save env
Expand Down

0 comments on commit c0462f2

Please sign in to comment.