From b86b265762289c066a728ad1a4b7f9f11e4bfa9f Mon Sep 17 00:00:00 2001 From: JackyWoo Date: Thu, 12 Sep 2024 15:48:20 +0800 Subject: [PATCH] Add ci test-request --- .github/workflows/build-and-test-asan.yml | 130 ++++++++++----------- .github/workflows/build-and-test-macos.yml | 122 +++++++++---------- .github/workflows/build-and-test-msan.yml | 130 ++++++++++----------- .github/workflows/build-and-test-tsan.yml | 130 ++++++++++----------- .github/workflows/build-and-test-ubsan.yml | 130 ++++++++++----------- .github/workflows/build-and-test.yml | 130 ++++++++++----------- .github/workflows/check-style.yml | 50 ++++---- .github/workflows/pull-request.yml | 110 +++++++++++++++++ 8 files changed, 521 insertions(+), 411 deletions(-) create mode 100644 .github/workflows/pull-request.yml diff --git a/.github/workflows/build-and-test-asan.yml b/.github/workflows/build-and-test-asan.yml index b689626ffe..b7839b919e 100644 --- a/.github/workflows/build-and-test-asan.yml +++ b/.github/workflows/build-and-test-asan.yml @@ -1,65 +1,65 @@ -name: build-and-test-asan - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo - -jobs: - build-and-test-asan: - name: "ubuntu clang" - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Prepare - run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 - - - name: Generate Makefile - run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=address - - - name: Build - working-directory: ${{github.workspace}}/build - run: ninja -j 10 - - - name: Run unit Tests - working-directory: ${{github.workspace}}/build - run: ./src/rk_unit_tests --gtest_color=yes - - - name: Run integration Tests - working-directory: ${{github.workspace}}/tests/integration - run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration +#name: build-and-test-asan +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# +# workflow_dispatch: +# inputs: +# pr: +# description: "Pull request#" +# required: false +# +#env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: RelWithDebInfo +# +#jobs: +# build-and-test-asan: +# name: "ubuntu clang" +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: recursive +# +# - name: Prepare +# run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 +# +# - name: Generate Makefile +# run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=address +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# run: ninja -j 10 +# +# - name: Run unit Tests +# working-directory: ${{github.workspace}}/build +# run: ./src/rk_unit_tests --gtest_color=yes +# +# - name: Run integration Tests +# working-directory: ${{github.workspace}}/tests/integration +# run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration diff --git a/.github/workflows/build-and-test-macos.yml b/.github/workflows/build-and-test-macos.yml index 18faa3b205..053209e164 100644 --- a/.github/workflows/build-and-test-macos.yml +++ b/.github/workflows/build-and-test-macos.yml @@ -1,61 +1,61 @@ -name: build-and-test-macos - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build-and-test: - name: "macos clang" - runs-on: macos-13 - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install tools - run: brew install ninja ccache cmake llvm@13 - - - name: Generate Makefile - run: export CC=$(brew --prefix llvm@13)/bin/clang CXX=$(brew --prefix llvm@13)/bin/clang++ && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - working-directory: ${{github.workspace}}/build - run: ninja -j 10 - - - name: Run unit Tests - working-directory: ${{github.workspace}}/build - run: ./src/rk_unit_tests --gtest_color=yes +#name: build-and-test-macos +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# +# workflow_dispatch: +# inputs: +# pr: +# description: "Pull request#" +# required: false +# +#env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: Release +# +#jobs: +# build-and-test: +# name: "macos clang" +# runs-on: macos-13 +# +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: recursive +# +# - name: Install tools +# run: brew install ninja ccache cmake llvm@13 +# +# - name: Generate Makefile +# run: export CC=$(brew --prefix llvm@13)/bin/clang CXX=$(brew --prefix llvm@13)/bin/clang++ && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# run: ninja -j 10 +# +# - name: Run unit Tests +# working-directory: ${{github.workspace}}/build +# run: ./src/rk_unit_tests --gtest_color=yes diff --git a/.github/workflows/build-and-test-msan.yml b/.github/workflows/build-and-test-msan.yml index 3ade784ce9..321d67ba77 100644 --- a/.github/workflows/build-and-test-msan.yml +++ b/.github/workflows/build-and-test-msan.yml @@ -1,65 +1,65 @@ -name: build-and-test-msan - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo - -jobs: - build-and-test-msan: - name: "ubuntu clang" - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Prepare - run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 - - - name: Generate Makefile - run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=memory - - - name: Build - working-directory: ${{github.workspace}}/build - run: ninja -j 10 - - - name: Run unit Tests - working-directory: ${{github.workspace}}/build - run: ./src/rk_unit_tests --gtest_color=yes - - - name: Run integration Tests - working-directory: ${{github.workspace}}/tests/integration - run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration +#name: build-and-test-msan +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# +# workflow_dispatch: +# inputs: +# pr: +# description: "Pull request#" +# required: false +# +#env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: RelWithDebInfo +# +#jobs: +# build-and-test-msan: +# name: "ubuntu clang" +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: recursive +# +# - name: Prepare +# run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 +# +# - name: Generate Makefile +# run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=memory +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# run: ninja -j 10 +# +# - name: Run unit Tests +# working-directory: ${{github.workspace}}/build +# run: ./src/rk_unit_tests --gtest_color=yes +# +# - name: Run integration Tests +# working-directory: ${{github.workspace}}/tests/integration +# run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration diff --git a/.github/workflows/build-and-test-tsan.yml b/.github/workflows/build-and-test-tsan.yml index eb13f9c5b4..6084e5954b 100644 --- a/.github/workflows/build-and-test-tsan.yml +++ b/.github/workflows/build-and-test-tsan.yml @@ -1,65 +1,65 @@ -name: build-and-test-tsan - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo - -jobs: - build-and-test-tsan: - name: "ubuntu clang" - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Prepare - run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 - - - name: Generate Makefile - run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=thread - - - name: Build - working-directory: ${{github.workspace}}/build - run: ninja -j 10 - - - name: Run unit Tests - working-directory: ${{github.workspace}}/build - run: ./src/rk_unit_tests --gtest_color=yes - - - name: Run integration Tests - working-directory: ${{github.workspace}}/tests/integration - run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration --tsan-options "report_thread_leaks=0:detect_deadlocks=0:halt_on_error=1:history_size=7:external_symbolizer_path=/usr/bin/llvm-symbolizer" +#name: build-and-test-tsan +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# +# workflow_dispatch: +# inputs: +# pr: +# description: "Pull request#" +# required: false +# +#env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: RelWithDebInfo +# +#jobs: +# build-and-test-tsan: +# name: "ubuntu clang" +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: recursive +# +# - name: Prepare +# run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 +# +# - name: Generate Makefile +# run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=thread +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# run: ninja -j 10 +# +# - name: Run unit Tests +# working-directory: ${{github.workspace}}/build +# run: ./src/rk_unit_tests --gtest_color=yes +# +# - name: Run integration Tests +# working-directory: ${{github.workspace}}/tests/integration +# run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration --tsan-options "report_thread_leaks=0:detect_deadlocks=0:halt_on_error=1:history_size=7:external_symbolizer_path=/usr/bin/llvm-symbolizer" diff --git a/.github/workflows/build-and-test-ubsan.yml b/.github/workflows/build-and-test-ubsan.yml index 42c786cc14..8a737a16ab 100644 --- a/.github/workflows/build-and-test-ubsan.yml +++ b/.github/workflows/build-and-test-ubsan.yml @@ -1,65 +1,65 @@ -name: build-and-test-ubsan - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: RelWithDebInfo - -jobs: - build-and-test-ubsan: - name: "ubuntu clang" - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Prepare - run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 - - - name: Generate Makefile - run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=undefined - - - name: Build - working-directory: ${{github.workspace}}/build - run: ninja -j 10 - - - name: Run unit Tests - working-directory: ${{github.workspace}}/build - run: ./src/rk_unit_tests --gtest_color=yes - - - name: Run integration Tests - working-directory: ${{github.workspace}}/tests/integration - run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration +#name: build-and-test-ubsan +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# +# workflow_dispatch: +# inputs: +# pr: +# description: "Pull request#" +# required: false +# +#env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: RelWithDebInfo +# +#jobs: +# build-and-test-ubsan: +# name: "ubuntu clang" +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: recursive +# +# - name: Prepare +# run: bash ${{github.workspace}}/.github/workflows/prepare-env.sh 14 +# +# - name: Generate Makefile +# run: clang -v && export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSANITIZE=undefined +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# run: ninja -j 10 +# +# - name: Run unit Tests +# working-directory: ${{github.workspace}}/build +# run: ./src/rk_unit_tests --gtest_color=yes +# +# - name: Run integration Tests +# working-directory: ${{github.workspace}}/tests/integration +# run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fce7c8eb78..91a11aeca4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -1,65 +1,65 @@ -name: build-and-test - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - pull_request: - types: - - opened - - synchronize - - reopened - paths-ignore: - - "**.md" - - "**/docs/**" - - "**/LICENSE" - - "**/NOTICE" - - "**/benchmark/**" - - "version.txt" - - "build.sh" - - workflow_dispatch: - inputs: - pr: - description: "Pull request#" - required: false - -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release - -jobs: - build-and-test: - name: "ubuntu clang" - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - - name: Install tools - run: sudo apt install -y ninja-build ccache - - - name: Generate Makefile - run: export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - working-directory: ${{github.workspace}}/build - run: ninja -j 10 - - - name: Run unit Tests - working-directory: ${{github.workspace}}/build - run: ./src/rk_unit_tests --gtest_color=yes - - - name: Run integration Tests - working-directory: ${{github.workspace}}/tests/integration - run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration +#name: build-and-test +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# paths-ignore: +# - "**.md" +# - "**/docs/**" +# - "**/LICENSE" +# - "**/NOTICE" +# - "**/benchmark/**" +# - "version.txt" +# - "build.sh" +# +# workflow_dispatch: +# inputs: +# pr: +# description: "Pull request#" +# required: false +# +#env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: Release +# +#jobs: +# build-and-test: +# name: "ubuntu clang" +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# with: +# submodules: recursive +# +# - name: Install tools +# run: sudo apt install -y ninja-build ccache +# +# - name: Generate Makefile +# run: export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} +# +# - name: Build +# working-directory: ${{github.workspace}}/build +# run: ninja -j 10 +# +# - name: Run unit Tests +# working-directory: ${{github.workspace}}/build +# run: ./src/rk_unit_tests --gtest_color=yes +# +# - name: Run integration Tests +# working-directory: ${{github.workspace}}/tests/integration +# run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration diff --git a/.github/workflows/check-style.yml b/.github/workflows/check-style.yml index 806d3fa908..a23f52bd18 100644 --- a/.github/workflows/check-style.yml +++ b/.github/workflows/check-style.yml @@ -1,25 +1,25 @@ -name: check-style - -on: # yamllint disable-line rule:truthy - push: - branches: - - master - pull_request: - types: - - opened - - synchronize - - reopened - -jobs: - check-style: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - - name: Install tools - run: sudo apt-get update && sudo apt install -y shellcheck libxml2-utils git python3-pip pylint yamllint && pip3 install codespell - - - name: Check style - working-directory: ${{github.workspace}}/tests/ci - run: python3 code_style_check.py +#name: check-style +# +#on: # yamllint disable-line rule:truthy +# push: +# branches: +# - master +# pull_request: +# types: +# - opened +# - synchronize +# - reopened +# +#jobs: +# check-style: +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# +# - name: Install tools +# run: sudo apt-get update && sudo apt install -y shellcheck libxml2-utils git python3-pip pylint yamllint && pip3 install codespell +# +# - name: Check style +# working-directory: ${{github.workspace}}/tests/ci +# run: python3 code_style_check.py diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000000..7f8f9b5563 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,110 @@ +name: pull-request + +on: # yamllint disable-line rule:truthy + push: + branches: + - master + paths-ignore: + - "**.md" + - "**/docs/**" + - "**/LICENSE" + - "**/NOTICE" + - "**/benchmark/**" + - "version.txt" + - "build.sh" + pull_request: + types: + - opened + - synchronize + - reopened + paths-ignore: + - "**.md" + - "**/docs/**" + - "**/LICENSE" + - "**/NOTICE" + - "**/benchmark/**" + - "version.txt" + - "build.sh" + + workflow_dispatch: + inputs: + pr: + description: "Pull request#" + required: false + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: RelWithDebInfo + +jobs: + check-style: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + + - name: Install tools + run: sudo apt-get update && sudo apt install -y shellcheck libxml2-utils git python3-pip pylint yamllint && pip3 install codespell + + - name: Check style + working-directory: ${{github.workspace}}/tests/ci + run: python3 code_style_check.py + + - name: print info + run: echo ${{github.workspace}} && echo ${{runner.temp}} && echo ${{runner.workspace}} + + build: + runs-on: ubuntu-22.04 + needs: check-style + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install tools + run: sudo apt install -y ninja-build ccache + + - name: Generate Makefile + run: export CC=`which clang` CXX=`which clang++` && cmake -G Ninja -B ./build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + working-directory: ${{github.workspace}}/build + run: ninja -j 10 + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: build + path: build/ + + unit-tests: + runs-on: ubuntu-22.04 + needs: build + steps: + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build + path: ${{github.workspace}}/build/ + + - name: Run unit Tests + working-directory: build + run: sudo ll ./src/rk_unit_tests && sudo chmod 755 ./src/rk_unit_tests && ./src/rk_unit_tests --gtest_color=yes + + integration-tests: + runs-on: ubuntu-22.04 + needs: build + steps: + - uses: actions/checkout@v3 + + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: build + path: ${{github.workspace}}/build/ + + - name: Add privileges + run: sudo ll ${{github.workspace}}/build/src/clickhouse* && sudo chmod 777 ${{github.workspace}}/build/src/clickhouse* + + - name: Run integration Tests + working-directory: ${{github.workspace}}/tests/integration + run: bash ${{github.workspace}}/.github/workflows/run-integration-test.sh ${{github.workspace}}/tests/integration