This is an automated email from the ASF dual-hosted git repository.

zhouxzhan pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git

commit 94dacc7c6ca7f921759967c9a4bae494e33d3f70
Author: deepsola <[email protected]>
AuthorDate: Mon Feb 6 17:41:39 2023 +0800

    Create pr-ci.yml
---
 .github/workflows/pr-ci.yml | 75 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml
new file mode 100644
index 000000000..57d3f5a7f
--- /dev/null
+++ b/.github/workflows/pr-ci.yml
@@ -0,0 +1,75 @@
+name: PR-CI
+
+on:
+  pull_request:
+
+jobs:
+  unit-test:
+    if: always()
+    name: Unit test
+    runs-on: ${{ matrix.os }}-latest
+    timeout-minutes: 30
+    strategy:
+      matrix:
+        os: [ubuntu, macos, windows]
+        java-version: [8]
+        include:
+          - os: ubuntu
+            java-version: 11
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: true
+      - name: Cache maven repository
+        uses: actions/cache@v3
+        with:
+          path: ~/.m2/repository
+          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-maven-
+      - uses: actions/setup-java@v3
+        with:
+          java-version: ${{ matrix.java-version }}
+          distribution: adopt
+      - name: Generate coverage report
+        run: |
+          cd broker
+          mvn -B test --file pom.xml
+      - name: Publish Test Report
+        uses: mikepenz/action-junit-report@v3
+        if: always() # always run even if the previous step fails
+        with:
+          report_paths: '**/surefire-reports/TEST-*.xml'
+          annotate_only: true
+          include_passed: true
+          detailed_summary: true
+  dist-tar:
+    if: ${{ success() }}
+    name: Build dist tar
+    needs: [unit-test]
+    runs-on: ubuntu-latest
+    timeout-minutes: 120
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: true
+      - uses: actions/setup-java@v3
+        with:
+          distribution: "temurin"
+          java-version: "8"
+          cache: "maven"
+      - name: Build distribution tar
+        run: |
+          mvn -Prelease-all -DskipTests clean install -U
+      - uses: actions/upload-artifact@v3
+        name: Upload distribution tar
+        with:
+          name: rocketmq
+          path: distribution/target/rocketmq*/rocketmq*
+      - name: Save PR number
+        run: |
+          mkdir -p ./pr
+          echo ${{ github.event.number }} > ./pr/NR
+      - uses: actions/upload-artifact@v2
+        with:
+          name: pr
+          path: pr/

Reply via email to