From 04483ece4176661ad9fefdad73d7674fbf91bc66 Mon Sep 17 00:00:00 2001 From: Jesse Gorzinski <17914061+ThePrez@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:18:16 -0500 Subject: [PATCH] ci: run tests Signed-off-by: John Eberhard <102746950+jeber-ibm@users.noreply.github.com> Signed-off-by: Jesse Gorzinski <17914061+ThePrez@users.noreply.github.com> --- .github/workflows/maven.yml | 44 +++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index eee5b6013..0240f86df 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -21,6 +21,12 @@ jobs: steps: - uses: actions/checkout@v3 + + - name: Get Maven project version + run: | + echo "project_version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec --file pom-dist.xml)" >> $GITHUB_ENV + cat $GITHUB_ENV + - name: Set up JDK 8 uses: actions/setup-java@v3 with: @@ -44,19 +50,39 @@ jobs: run: ls -l target - name: Copy dist artifacts to staging directory run: mkdir staging && cp target/*.jar staging - - name: Set up JDK 17 + - name: Upload dist artifacts + uses: actions/upload-artifact@v3 + with: + name: Package + path: staging + + - name: Create test output file + run: touch test_output.txt + + - name: Retrieve test suite + run: wget https://github.com/IBM/JTOpen-test/releases/download/v1.0.2/JTOpen-test-1.0.2.jar -O test.jar + + - name: Set up JDK 8 tor testing uses: actions/setup-java@v3 with: - java-version: '17' + java-version: '8' distribution: 'temurin' cache: maven - - name: Clean target - run: rm -r target - - name: Build with Maven (Java 17) - run: mvn -B package --file pom.xml - - name: Upload dist artifacts + + - name: Run JDBC UserSpace, DataArea, CommandCall, and Conv tests with Java 8 -- no DDM, takes too long + run: java -cp staging/jt400-${{ env.project_version }}-java8.jar:test.jar test.RegressionTest -tc JDBC -tc UserSpace -tc DataArea -tc Conv -tc CommandCall -system ${{ secrets.IBMI_TEST_SYS }} -uid ${{ secrets.IBMI_TEST_USER }} -pwd ${{ secrets.IBMI_TEST_PW }} -pwrSys ${{ secrets.IBMI_POWERTEST_USER }},${{ secrets.IBMI_POWERTEST_PW }} > test_output.txt 2>&1 + + - name: Display test success counts + if: always() + run: grep '=' test_output.txt | grep SUCCESS + - name: Display test failure counts + if: always() + run: grep '=' test_output.txt | grep FAIL + + - name: Upload test results + if: always() uses: actions/upload-artifact@v3 with: - name: Package - path: staging + name: Tests + path: test_output.txt