Skip to content

Commit 61fdeba

Browse files
committed
ci: add test workflow
1 parent eedee34 commit 61fdeba

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Single IntegrationTest
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
depend_tasks:
7+
description: '前置构建任务,如 :boot:jar :generator:jar'
8+
required: false
9+
default: '":vul:vul-webapp:war :vul:vul-webapp-expression:war :vul:vul-webapp-deserialize:war :vul:vul-webapp-jakarta:war"'
10+
type: string
11+
test_class:
12+
description: '测试用例类名,如 com.reajason.javaweb.integration.memshell.tomcat.Tomcat10WebSocketBypassNginxTest'
13+
required: true
14+
type: string
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
integration-test:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Java
28+
uses: actions/setup-java@v4
29+
with:
30+
distribution: 'temurin'
31+
java-version: 17
32+
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@v4
35+
36+
- name: Prepare for Integration Test
37+
if: ${{ inputs.depend_tasks != '' }}
38+
run: ./gradlew ${{ inputs.depend_tasks }}
39+
40+
- name: Integration Test with gradle
41+
run: ./gradlew :integration-test:test --tests '${{ inputs.test_class }}' --info
42+
43+
- name: Export Integration Test Summary
44+
uses: mikepenz/action-junit-report@v5
45+
if: success() || failure()
46+
with:
47+
report_paths: '**/build/test-results/test/TEST-*.xml'

0 commit comments

Comments
 (0)