-
Notifications
You must be signed in to change notification settings - Fork 33
88 lines (73 loc) · 2.88 KB
/
maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Maven
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
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:
java-version: '8'
distribution: 'temurin'
cache: maven
- name: Build with Maven (Java 8)
run: mvn -B package --file pom.xml
- name: Clean target
run: rm -r target
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Full dist build
run: mvn -B package --file pom-dist.xml
- name: List target directory
run: ls -l target
- name: Copy dist artifacts to staging directory
run: mkdir staging && cp target/*.jar staging
- 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: '8'
distribution: 'temurin'
cache: maven
- 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: Tests
path: test_output.txt