-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (64 loc) · 2.65 KB
/
test.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
name: test-all
on:
push:
branches-ignore:
- 'dependabot/**' #avoid duplicates: only run the PR, not the commit
tags-ignore:
- 'v*' #avoids rerun existing commit on release
pull_request:
branches:
- 'main'
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v4
- name: Select Java Version
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Server - Build and test (UT)
run: mvn package -pl server-spring -Dmaven.test.failure.ignore=false -U --no-transfer-progress
- name: Server - Deploy container
run: |
set -x
cp server-spring/target/samples-openapi-server-spring-*.jar server-spring/target/server-spring-deploy.jar
docker build --pull -t server-spring ./server-spring
docker run -d -p 8080:8080 --name server-spring --restart unless-stopped server-spring
sleep 5 #some time ensure server up
docker logs server-spring
- name: Java Clients - Test (IT)
run: mvn test -pl client-resttemplate,client-httpclient -Dmaven.test.failure.ignore=false -U --no-transfer-progress
- name: Netcore Client - Prepare environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
#Generates api with maven for unified generation
#Run build before test to fail if complie errors
- name: Netcore Client - Test (IT)
run: |
mvn generate-sources -pl client-netcore -Dmaven.test.failure.ignore=false -U --no-transfer-progress
echo "*** Build and test netcore client"
dotnet build client-netcore/client-netcore.sln
dotnet test --logger "trx;LogFileName=../../target/nunit-report.trx" client-netcore/client-netcore/client-netcore.csproj || exit 0
#Convert net test reports to surefire junit format for unified reporting
- name: Netcore Client - Split test reports to surefire format
run: |
dotnet tool install --global DotnetTestSplit
DotnetTestSplit client-netcore/target/nunit-report.trx client-netcore/target/surefire-reports
- if: always()
name: Publish test report artifacts
uses: actions/[email protected]
with:
name: test-reports
path: ./**/target/surefire-reports/
- name: Publish test reports
if: always()
uses: mikepenz/[email protected]
with:
check_name: test-report
report_paths: '**/target/surefire-reports/TEST-*.xml'
fail_on_failure: 'true'