Skip to content

Commit

Permalink
Enables clang-tidy and clang-format check
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix "xq" Queißner committed Jul 1, 2023
1 parent 6ba850a commit 8c6ea86
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/guidelines.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Code Check

on:
push:
branches: ['main']
pull_request:
branches: ['main', 'format_tooling']

jobs:
validate-format:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.11.0
with:
clang-format-version: '16'
check-path: '.'

static-analysis:
runs-on: ubuntu-22.04

# might be enabled in the future:
# https://github.com/marketplace/actions/clang-tidy-review

steps:
- uses: actions/checkout@v3

- name: Fetch & install RISC-V GNU Compiler Toolchain
run: |
curl -Lo riscv32-elf-ubuntu-22.04-nightly.tar.gz 'https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.06.09/riscv32-elf-ubuntu-22.04-nightly-2023.06.09-nightly.tar.gz'
tar -xf riscv32-elf-ubuntu-22.04-nightly.tar.gz
echo "${PWD}/riscv/bin" >> $GITHUB_PATH
- name: Configure CMake
run: cmake -B "${{github.workspace}}/build" -DCMAKE_BUILD_TYPE=Debug

- name: Run clang-tidy
id: linter
uses: cpp-linter/cpp-linter-action@v2
with:
style: 'file'
version: '16'
thread-comments: false # do not post review summary
file-annotations: false # disable review comments
lines-changed-only: false # scan everything
database: '${{github.workspace}}/build'

- name: Analysis failed
if: steps.linter.outputs.checks-failed > 0
run: exit 1

0 comments on commit 8c6ea86

Please sign in to comment.