You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pegasus.apache.org by ji...@apache.org on 2022/08/18 03:49:46 UTC

[incubator-pegasus] 01/03: fix(github): fix the conditions for file changes that trigger workflows (#1123)

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

jiashuo pushed a commit to branch v2.4
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git

commit 00aadc71cec14a7386dca268d9fc6175c111f606
Author: Dan Wang <wa...@apache.org>
AuthorDate: Wed Aug 17 11:03:10 2022 +0800

    fix(github): fix the conditions for file changes that trigger workflows (#1123)
---
 .github/workflows/lint_and_test_cpp.yaml | 154 +++++++++++++++++++++----------
 1 file changed, 104 insertions(+), 50 deletions(-)

diff --git a/.github/workflows/lint_and_test_cpp.yaml b/.github/workflows/lint_and_test_cpp.yaml
index 2a8cace2d..4d4f38eb3 100644
--- a/.github/workflows/lint_and_test_cpp.yaml
+++ b/.github/workflows/lint_and_test_cpp.yaml
@@ -32,6 +32,13 @@ on:
       - 'v[0-9]+.*' # release branch
       - ci-test # testing branch for github action
       - '*dev'
+    paths:
+      - '.github/workflows/lint_and_test_cpp.yaml'
+      - 'CMakeLists.txt'
+      - 'run.sh'
+      - 'cmake_modules/**'
+      - 'src/**'
+      - 'thirdparty/**'
 
   # for manually triggering workflow
   workflow_dispatch:
@@ -74,12 +81,6 @@ jobs:
         id: changes
         with:
           filters: |
-            base:
-              - 'cmake_modules/**'
-              - 'CMakeLists.txt'
-              - 'run.sh'
-            rdsn:
-              - 'src/rdsn/**'
             thirdparty:
               - 'thirdparty/**'
       - name: Unpack prebuilt third-parties
@@ -93,14 +94,24 @@ jobs:
           cmake -DCMAKE_BUILD_TYPE=Release -B build/
           cmake --build build/ -j $(($(nproc)/2+1))
       - name: Compilation
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
-        run: ./run.sh build -c --rdsn --test --skip_thirdparty -j $(($(nproc)/2+1))
-      - name: Unit Testing
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
         run: |
-          export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
-          ulimit -s unlimited
-          ./run.sh test --rdsn
+          ccache -p
+          ccache -z
+          ./run.sh build --test --skip_thirdparty -j $(nproc) -t release
+          ccache -s
+      - name: Pack Server
+        run: ./run.sh pack_server
+      - name: Pack Tools
+        run: ./run.sh pack_tools
+      - name: Tar files
+        run: |
+          rm -rf thirdparty
+          tar -zcvhf release__builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini --exclude='*CMakeFiles*'
+      - name: Upload Artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: release_artifact_${{ github.sha }}
+          path: release__builder.tar
 
   test_rdsn_ASAN:
     name: Test rdsn with ASAN
@@ -170,12 +181,6 @@ jobs:
         id: changes
         with:
           filters: |
-            base:
-              - 'cmake_modules/**'
-              - 'CMakeLists.txt'
-              - 'run.sh'
-            rdsn:
-              - 'src/rdsn/**'
             thirdparty:
               - 'thirdparty/**'
       - name: Unpack prebuilt third-parties
@@ -189,14 +194,20 @@ jobs:
           cmake -DCMAKE_BUILD_TYPE=Release -B build/
           cmake --build build/ -j $(($(nproc)/2+1))
       - name: Compilation
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
-        run: ./run.sh build -c --rdsn --test --sanitizer leak --skip_thirdparty --disable_gperf -j $(($(nproc)/2+1))
-      - name: Unit Testing
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.rdsn == 'true' || steps.changes.outputs.thirdparty == 'true'
         run: |
-          export LD_LIBRARY_PATH=`pwd`/thirdparty/output/lib:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server
-          ulimit -s unlimited
-          ./run.sh test --rdsn
+          ccache -p
+          ccache -z
+          ./run.sh build --test --sanitizer address --skip_thirdparty --disable_gperf -j $(nproc)
+          ccache -s
+      - name: Tar files
+        run: |
+          rm -rf thirdparty
+          tar -zcvhf release_address_builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini --exclude='*CMakeFiles*'
+      - name: Upload Artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: release_address_artifact_${{ github.sha }}
+          path: release_address_builder.tar
 
   test_rdsn_UBSAN:
     name: Test rdsn with UBSAN
@@ -262,12 +273,6 @@ jobs:
         id: changes
         with:
           filters: |
-            base:
-              - 'cmake_modules/**'
-              - 'CMakeLists.txt'
-              - 'run.sh'
-            pegasus:
-              - 'src/**'
             thirdparty:
               - 'thirdparty/**'
       - name: Unpack prebuilt third-parties
@@ -281,14 +286,68 @@ jobs:
           cmake -DCMAKE_BUILD_TYPE=Release -B build/
           cmake --build build/ -j $(($(nproc)/2+1))
       - name: Compilation
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
-        run: ./run.sh build --test -c -j $(($(nproc)/2+1)) --skip_thirdparty
-      - name: Packaging Server
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
-        run: ./run.sh pack_server
-      - name: Packaging Tools
-        if: steps.changes.outputs.base == 'true' || steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
-        run: ./run.sh pack_tools
+        run: |
+          ccache -p
+          ccache -z
+          ./run.sh build --test --sanitizer undefined --skip_thirdparty --disable_gperf -j $(nproc)
+          ccache -s
+      - name: Tar files
+        run: |
+          rm -rf thirdparty
+          tar -zcvhf release_undefined_builder.tar DSN_ROOT/ src/builder/bin src/builder/src/server/test/config.ini --exclude='*CMakeFiles*'
+      - name: Upload Artifact
+        uses: actions/upload-artifact@v3
+        with:
+          name: release_undefined_artifact_${{ github.sha }}
+          path: release_undefined_builder.tar
+
+  test_UBSAN:
+    name: Test UBSAN
+    strategy:
+      fail-fast: false
+      matrix:
+        test_module:
+          - base_test
+          - dsn_aio_test
+          - dsn_block_service_test
+          - dsn.failure_detector.tests
+          - dsn_http_test
+          - dsn_meta_state_tests
+          - dsn.meta.test
+          - dsn_nfs_test
+          - dsn_perf_counter_test
+          - dsn_replica_backup_test
+          - dsn_replica_bulk_load_test
+          - dsn_replica_dup_test
+          - dsn_replica_split_test
+          - dsn.replica.test
+          - dsn_replication_common_test
+          - dsn.replication.simple_kv
+          - dsn.rep_tests.simple_kv
+          - dsn_runtime_tests
+          - dsn_utils_tests
+          - dsn.zookeeper.tests
+          - pegasus_function_test
+          - pegasus_geo_test
+          - pegasus_rproxy_test
+          - pegasus_unit_test
+    needs: build_UBSAN
+    runs-on: ubuntu-latest
+    container:
+      image: apache/pegasus:thirdparties-bin-ubuntu1804-${{ github.base_ref }}
+      options: --cap-add=SYS_PTRACE
+    steps:
+      - uses: actions/checkout@v2
+      - name: Unpack prebuilt third-parties
+        run: unzip /root/thirdparties-bin.zip -d ./thirdparty
+      - name: Download Artifact
+        uses: actions/download-artifact@v3
+        with:
+          name: release_undefined_artifact_${{ github.sha }}
+          path: .
+      - name: Tar files
+        run: |
+          tar -zxvf release_undefined_builder.tar
       - name: Unit Testing
         if: steps.changes.outputs.base == 'true' || steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
         run: |
@@ -324,14 +383,9 @@ jobs:
           mkdir -p build
           cmake -DCMAKE_BUILD_TYPE=Release -B build/ -DMACOS_OPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}
           cmake --build build/ -j $(sysctl -n hw.physicalcpu)
-      - uses: dorny/paths-filter@v2
-        id: changes
-        with:
-          filters: |
-            pegasus:
-              - 'src/**'
-            thirdparty:
-              - 'thirdparty/**'
       - name: Compilation
-        if: steps.changes.outputs.pegasus == 'true' || steps.changes.outputs.thirdparty == 'true'
-        run: ./run.sh build --test --skip_thirdparty -c -j $(sysctl -n hw.physicalcpu)
+        run: |
+          ccache -p
+          ccache -z
+          ./run.sh build --test --skip_thirdparty -j $(sysctl -n hw.physicalcpu)
+          ccache -s


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pegasus.apache.org
For additional commands, e-mail: commits-help@pegasus.apache.org