From 3ead70ac6e83b99a07ddbd5dba8e23a6ad7a5722 Mon Sep 17 00:00:00 2001 From: quicksilver Date: Tue, 24 Nov 2020 11:20:44 +0800 Subject: [PATCH] Add Code check workflow Signed-off-by: quicksilver --- .github/workflows/code-checker.yaml | 53 +++++++++++++++++++++++++++++ .github/workflows/main.yaml | 8 +---- scripts/core_build.sh | 12 +++---- 3 files changed, 60 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/code-checker.yaml diff --git a/.github/workflows/code-checker.yaml b/.github/workflows/code-checker.yaml new file mode 100644 index 0000000000..9f14992b99 --- /dev/null +++ b/.github/workflows/code-checker.yaml @@ -0,0 +1,53 @@ +name: Code Checker +# TODO: do not trigger action for some document file update + +# This workflow is triggered on pushes or pull request to the repository. +on: + push: + # file paths to consider in the event. Optional; defaults to all. + paths: + - 'scripts/**' + - 'internal/**' + - 'cmd/**' + - 'build/**' + - '.github/workflows/code-checker.yaml' + - '.env' + - docker-compose.yml + - Makefile + - '!**.md' + pull_request: + # file paths to consider in the event. Optional; defaults to all. + paths: + - 'scripts/**' + - 'internal/**' + - 'cmd/**' + - 'build/**' + - '.github/workflows/code-checker.yaml' + - '.env' + - docker-compose.yml + - Makefile + - '!**.md' + +jobs: + ubuntu: + name: AMD64 Ubuntu ${{ matrix.ubuntu }} + runs-on: ubuntu-latest + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + ubuntu: [18.04] + env: + UBUNTU: ${{ matrix.ubuntu }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Dockerfile Lint + uses: reviewdog/action-hadolint@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-check # Default is github-pr-check + hadolint_ignore: DL3008 + - name: Code Check + run: | + ./build/builder.sh /bin/bash -c "make check-proto-product && make verifiers" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4522df6653..b764b9641c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -42,12 +42,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Check Dockerfile - uses: reviewdog/action-hadolint@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-check # Default is github-pr-check - hadolint_ignore: DL3008 - name: Cache Docker Volumes uses: actions/cache@v1 with: @@ -62,4 +56,4 @@ jobs: env: CHECK_BUILDER: "1" run: | - ./build/builder.sh + ./build/builder.sh /bin/bash -c "make check-proto-product && make unittest" diff --git a/scripts/core_build.sh b/scripts/core_build.sh index 2448254a67..7edd18ed2e 100755 --- a/scripts/core_build.sh +++ b/scripts/core_build.sh @@ -154,12 +154,12 @@ if [[ ${RUN_CPPLINT} == "ON" ]]; then echo "clang-format check passed!" # clang-tidy check - make check-clang-tidy || true - if [ $? -ne 0 ]; then - echo "ERROR! clang-tidy check failed" - exit 1 - fi - echo "clang-tidy check passed!" + # make check-clang-tidy || true + # if [ $? -ne 0 ]; then + # echo "ERROR! clang-tidy check failed" + # exit 1 + # fi + # echo "clang-tidy check passed!" else # compile and build make -j ${jobs} install || exit 1