From 0d5ac2a5e2799cc3be70f961ab995073247f4b16 Mon Sep 17 00:00:00 2001 From: linD026 Date: Thu, 23 Sep 2021 20:01:13 +0800 Subject: [PATCH] CI: Enforce status checks once pull requests received (#113) We tend to reject the pull requests if they fail to pass coding style checks and static analysis. See https://www.wesleyhaakman.org/working-with-pull-requests-status-checks-arm-templates-and-github-actions/ --- .github/workflows/generate_doc.yaml | 14 -------------- .github/workflows/status-check.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/status-check.yaml diff --git a/.github/workflows/generate_doc.yaml b/.github/workflows/generate_doc.yaml index e00910d..a6aec8a 100644 --- a/.github/workflows/generate_doc.yaml +++ b/.github/workflows/generate_doc.yaml @@ -35,17 +35,3 @@ jobs: lkmpg-html.tar.gz tag_name: "latest" prerelease: true - - validate: - runs-on: ubuntu-20.04 - steps: - - name: checkout code - uses: actions/checkout@v2 - - name: validate coding style and functionality - run: | - sudo apt-get install -q -y clang-format-11 - sudo apt-get install -q -y cppcheck - .ci/check-format.sh - .ci/static-analysis.sh - .ci/build-n-run.sh - shell: bash diff --git a/.github/workflows/status-check.yaml b/.github/workflows/status-check.yaml new file mode 100644 index 0000000..e89a9fa --- /dev/null +++ b/.github/workflows/status-check.yaml @@ -0,0 +1,24 @@ +name: status-checks + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + validate: + runs-on: ubuntu-20.04 + steps: + - name: checkout code + uses: actions/checkout@v2 + - name: validate coding style and functionality + run: | + sudo apt-get install -q -y clang-format-11 + sudo apt-get install -q -y cppcheck + .ci/check-format.sh + .ci/static-analysis.sh + .ci/build-n-run.sh + shell: bash -- 2.39.5