mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
ci: separate unit test and integration test
This commit is contained in:
@@ -9,10 +9,25 @@ on:
|
||||
- '**.md'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build -x test
|
||||
unit-test:
|
||||
name: UniteTest
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -24,12 +39,49 @@ jobs:
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Unit Test with Gradle
|
||||
run: ./gradlew :generator:test --info
|
||||
run: ./gradlew :generator:test
|
||||
- name: Upload Jacoco
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ github.job }}
|
||||
path: generator/build/jacoco/test.exec
|
||||
integration-test:
|
||||
strategy:
|
||||
matrix:
|
||||
middleware: [ "Tomcat", "Jetty" ]
|
||||
runs-on: ubuntu-latest
|
||||
name: ${{ matrix.middleware }}
|
||||
needs: [ build, unit-test ]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Integration Test with gradle
|
||||
run: ./gradlew :integration-test:test --info
|
||||
continue-on-error: true
|
||||
run: ./gradlew :integration-test:test --tests '${{ matrix.middleware }}*'
|
||||
- name: Export Integration Test Summary
|
||||
run: cat integration-test/build/test-results/report.md >> $GITHUB_STEP_SUMMARY
|
||||
- name: Upload jacoco
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.middleware }}
|
||||
path: integration-test/build/jacoco/test.exec
|
||||
coverage:
|
||||
name: Coverage
|
||||
needs: [ build, unit-test, integration-test ]
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Download Jacoco
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: integration-test/build/jacoco
|
||||
- name: Merge Jacoco
|
||||
run: ./gradlew :jacocoTestReport
|
||||
- name: Generate JaCoCo Badge
|
||||
@@ -43,7 +95,7 @@ jobs:
|
||||
coverage-endpoint-filename: jacoco.json
|
||||
generate-summary: true
|
||||
summary-filename: coverage-summary.json
|
||||
- name: Upload
|
||||
- name: Commit Badges
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
with:
|
||||
file_pattern: ".github/badges/**"
|
||||
|
||||
Reference in New Issue
Block a user