mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-24 07:51:52 +08:00
ci: separate unit test and integration test
This commit is contained in:
@@ -9,10 +9,25 @@ on:
|
|||||||
- '**.md'
|
- '**.md'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
build:
|
||||||
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
steps:
|
||||||
contents: write
|
- 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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -24,12 +39,49 @@ jobs:
|
|||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
- name: Unit Test with Gradle
|
- 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
|
- name: Integration Test with gradle
|
||||||
run: ./gradlew :integration-test:test --info
|
run: ./gradlew :integration-test:test --tests '${{ matrix.middleware }}*'
|
||||||
continue-on-error: true
|
|
||||||
- name: Export Integration Test Summary
|
- name: Export Integration Test Summary
|
||||||
run: cat integration-test/build/test-results/report.md >> $GITHUB_STEP_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
|
- name: Merge Jacoco
|
||||||
run: ./gradlew :jacocoTestReport
|
run: ./gradlew :jacocoTestReport
|
||||||
- name: Generate JaCoCo Badge
|
- name: Generate JaCoCo Badge
|
||||||
@@ -43,7 +95,7 @@ jobs:
|
|||||||
coverage-endpoint-filename: jacoco.json
|
coverage-endpoint-filename: jacoco.json
|
||||||
generate-summary: true
|
generate-summary: true
|
||||||
summary-filename: coverage-summary.json
|
summary-filename: coverage-summary.json
|
||||||
- name: Upload
|
- name: Commit Badges
|
||||||
uses: stefanzweifel/git-auto-commit-action@v5
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
file_pattern: ".github/badges/**"
|
file_pattern: ".github/badges/**"
|
||||||
|
|||||||
Reference in New Issue
Block a user