From 6c94a853cfabf0eea738bde28fd3a179b4a055f0 Mon Sep 17 00:00:00 2001 From: "Henning P. Schmiedehausen" Date: Thu, 16 Nov 2023 21:17:34 -0800 Subject: [PATCH] update CI pipeline --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11dcc55..7b375b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,10 @@ env: jobs: ci: runs-on: ubuntu-latest + strategy: + matrix: + java-version: [ 11, 17, 21 ] + distribution: [ temurin ] steps: - uses: actions/checkout@v4 @@ -27,11 +31,44 @@ jobs: distribution: temurin cache: maven - - name: Build + - uses: actions/setup-java@v3 + id: setup_test_jdk + name: Setup Test JDK + with: + java-version: ${{ matrix.java-version }} + distribution: temurin + cache: maven + + - id: set_build_jdk + name: Set the Build JDK + env: + JAVA_HOME: ${{ steps.setup_build_jdk.outputs.path }} + run: | + echo "$JAVA_HOME/bin" >> ${GITHUB_PATH} + + - id: build_distribution + name: Build the distribution + env: + JAVA_HOME: ${{ steps.setup_build_jdk.outputs.path }} + run: | + ./mvnw -DskipTests clean install + + - id: set_test_jdk + name: Set the Test JDK + env: + JAVA_HOME: ${{ steps.setup_test_jdk.outputs.path }} + run: | + echo "$JAVA_HOME/bin" >> ${GITHUB_PATH} + + - id: run_tests + name: Run the tests + env: + JAVA_HOME: ${{ steps.setup_test_jdk.outputs.path }} run: | - ./mvnw clean install + ./mvnw surefire:test - - name: Package + - id: package + name: Archive the build folder if: failure() run: | FOLDER=$(basename `pwd`) @@ -40,7 +77,8 @@ jobs: mv ${{ runner.temp }}/${{ env.tarFile }} ${{ github.workspace }} - uses: keithweaver/aws-s3-github-action@v1.0.0 - name: Upload + id: upload + name: Upload the build archive to S3 if: failure() with: command: cp