Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run tests #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 35 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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