From df106d9beffb277d6bcedc192355c3b2f8090d86 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Thu, 6 Oct 2022 19:21:25 -0700 Subject: [PATCH] [ci] added a workflow to check code format --- .github/workflows/format.yaml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/format.yaml diff --git a/.github/workflows/format.yaml b/.github/workflows/format.yaml new file mode 100644 index 000000000..29dd8dfa5 --- /dev/null +++ b/.github/workflows/format.yaml @@ -0,0 +1,39 @@ +name: Code Format + +# Run CI on push, PR, and weekly. + +on: + push: + pull_request: + schedule: + - cron: "0 0 * * 0 " # weekly + +# Multiple job to tests +jobs: + change_detect: + name: "Check" + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + config: + - name: "C/C++" + code_type: "-cpp" + steps: + - name: Cancel previous + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + + - name: Install dependencies + run: ./.github/workflows/install_dependencies_build.sh + + - name: Dump tool versions + run: | + clang-format-10 --version + + - name: Checkout OpenFPGA repo + uses: actions/checkout@v2 + + - name: Check format + run: ./dev/check-format.sh ${{ matrix.config.code_type }}