From 9ea8dad68b129288efc52b475e5a952a227c5648 Mon Sep 17 00:00:00 2001 From: ReaJason Date: Sun, 2 Feb 2025 22:22:40 +0800 Subject: [PATCH] ci: rm coverage --- .github/badges/coverage-summary.json | 1 - .github/badges/jacoco.json | 1 - .github/workflows/build.yaml | 24 ++---- .github/workflows/ci.yaml | 121 --------------------------- .github/workflows/test.yaml | 75 +++++++++++++++++ README.md | 5 +- 6 files changed, 86 insertions(+), 141 deletions(-) delete mode 100644 .github/badges/coverage-summary.json delete mode 100644 .github/badges/jacoco.json delete mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/badges/coverage-summary.json b/.github/badges/coverage-summary.json deleted file mode 100644 index b6100321..00000000 --- a/.github/badges/coverage-summary.json +++ /dev/null @@ -1 +0,0 @@ -{"branches": 67.0103092783505, "coverage": 75.38887705092692} \ No newline at end of file diff --git a/.github/badges/jacoco.json b/.github/badges/jacoco.json deleted file mode 100644 index e677f15f..00000000 --- a/.github/badges/jacoco.json +++ /dev/null @@ -1 +0,0 @@ -{"color": "#dfb317", "label": "coverage", "message": "75.3%", "schemaVersion": 1} \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5c93e04a..b9675bb7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,8 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - name: Setup Java uses: actions/setup-java@v4 @@ -31,16 +29,13 @@ jobs: with: bun-version: latest - - name: Bun Install - run: cd web && bun install --frozen-lockfile - - name: Build Web - run: cd web && bun run build - - name: Test Boot with Gradle - run: ./gradlew :boot:test - - name: Build with Gradle - run: ./gradlew :boot:bootjar + - name: Build Web with Bun + run: cd web && bun install --frozen-lockfile && bun run build - - name: Upload Jar + - name: Build Boot with Gradle + run: ./gradlew :boot:bootjar -x test + + - name: Upload Boot Jar uses: actions/upload-artifact@v4 with: name: boot @@ -52,10 +47,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Download Jar + - name: Download Boot Jar uses: actions/download-artifact@v4 with: name: boot @@ -71,6 +64,7 @@ jobs: - name: Login to Docker Hub uses: docker/login-action@v3 with: + registry: docker.io username: ${{ vars.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -86,7 +80,7 @@ jobs: platforms: linux/amd64,linux/arm64 push: true tags: | - reajason/memshell-party:latest + docker.io/reajason/memshell-party:latest ghcr.io/reajason/memshell-party:latest deploy-northflank: diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index f782842e..00000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,121 +0,0 @@ -name: Test - -on: - push: - paths-ignore: - - 'docs/**' - - 'boot/**' - - 'web/**' - - '**.md' -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - unit-test: - name: UniteTest - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Unit Test with Gradle - run: ./gradlew :generator:test - integration-test: - strategy: - fail-fast: false - matrix: - middleware: - - tomcat - - jetty - - jbossas - - jbosseap - - wildfly - - glassfish - - resin - - payara - - websphere - - springmvc - - weblogic - - springwebflux - - xxljob - runs-on: ubuntu-latest - name: ${{ matrix.middleware }} - needs: [ unit-test ] - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - 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 --tests '*.${{ matrix.middleware }}.*' --info - - 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 }}-integration-test - path: integration-test/build/jacoco/test.exec - retention-days: 1 - coverage: - name: Coverage - needs: [ unit-test, integration-test ] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Unit Test with Gradle - run: ./gradlew :generator:test - - name: Download Jacoco - uses: actions/download-artifact@v4 - with: - path: build/jacoco - - name: Merge Jacoco - run: ./gradlew :jacocoTestReport --info - - name: Generate JaCoCo Badge - uses: cicirello/jacoco-badge-generator@v2 - with: - jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv - badges-directory: .github/badges - generate-coverage-badge: false - generate-branches-badge: false - generate-coverage-endpoint: true - coverage-endpoint-filename: jacoco.json - generate-summary: true - summary-filename: coverage-summary.json - - name: Commit Badges - uses: stefanzweifel/git-auto-commit-action@v5 - with: - file_pattern: ".github/badges/**" - commit_message: "ci: update badge" \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..df941b5d --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,75 @@ +name: Test + +on: + push: + paths-ignore: + - 'docs/**' + - 'boot/**' + - 'web/**' + - '**.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + unit-test: + name: UniteTest + runs-on: ubuntu-latest + 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: Generator Unit Test with Gradle + run: ./gradlew :generator:test + + - name: Boot Unit Test with Gradle + run: ./gradlew :boot:test + + integration-test: + strategy: + fail-fast: false + matrix: + middleware: + - tomcat + - jetty + - jbossas + - jbosseap + - wildfly + - glassfish + - resin + - payara + - websphere + - springmvc + - weblogic + - springwebflux + - xxljob + runs-on: ubuntu-latest + name: ${{ matrix.middleware }} + needs: [ 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 --tests '*.${{ matrix.middleware }}.*' --info + - name: Export Integration Test Summary + run: cat integration-test/build/test-results/report.md >> $GITHUB_STEP_SUMMARY \ No newline at end of file diff --git a/README.md b/README.md index 15d63dc6..f1cc0d92 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,8 @@

一键生成常见中间件框架内存马,让内存马测试变得简单高效,打造内存马的全方位学习平台

在遍地是轮子的时代,是时候造车,带着大伙加速冲冲冲了

-[![test](https://img.shields.io/github/actions/workflow/status/reajason/memshellparty/ci.yaml?label=Test&branch=master&style=flat-square&color=blueviolet)](https://github.com/ReaJason/MemShellParty/actions) +[![test](https://img.shields.io/github/actions/workflow/status/reajason/memshellparty/test.yaml?label=Test&branch=master&style=flat-square&color=blueviolet)](https://github.com/ReaJason/MemShellParty/actions) [![build](https://img.shields.io/github/actions/workflow/status/reajason/memshellparty/build.yaml?label=Build&branch=master&style=flat-square&color=blueviolet)](https://github.com/ReaJason/MemShellParty/actions) -[![coverage](https://img.shields.io/endpoint?label=Coverage&url=https://raw.githubusercontent.com/reajason/memshellparty/master/.github/badges/jacoco.json&style=flat-square&color=blueviolet)](https://github.com/ReaJason/MemShellParty/actions) [![license](https://img.shields.io/github/license/reajason/memshellparty?style=flat-square&label=License&color=blueviolet)](https://github.com/ReaJason/MemShellParty?tab=MIT-1-ov-file) [![Telegram](https://img.shields.io/badge/Telegram-2CA5E0?style=flat-square&logo=telegram&logoColor=white)](https://t.me/memshell) @@ -25,7 +24,7 @@ ## 主要特性 -- 自动化测试保障: 自带完备的 [CI 集成测试](https://github.com/ReaJason/MemShellParty/actions/workflows/ci.yaml) +- 自动化测试保障: 自带完备的 [CI 集成测试](https://github.com/ReaJason/MemShellParty/actions/workflows/test.yaml) ,确保常见场景下的高可用性。 - 优化的用例设计: 尽可能精简内存马大小,高效传输。 - 广泛的兼容性: 覆盖攻防场景下常见中间件和框架。