Skip to content

Commit 7fc9a8c

Browse files
authored
Create lint.yml
Signed-off-by: Andy Zhang <[email protected]>
1 parent e03138a commit 7fc9a8c

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/lint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
2+
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
3+
name: Lint
4+
5+
on:
6+
push:
7+
branches: [ "main" ]
8+
pull_request:
9+
branches: [ "main" ]
10+
11+
env:
12+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
13+
BUILD_TYPE: Release
14+
15+
jobs:
16+
build:
17+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
18+
# You can convert this to a matrix build if you need cross-platform coverage.
19+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
20+
runs-on: macos-latest
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Homebrew
26+
id: set-up-homebrew
27+
uses: Homebrew/actions/setup-homebrew@master
28+
29+
- name: Install LLVM
30+
run: brew install llvm
31+
32+
- name: Setup Python
33+
uses: actions/[email protected]
34+
with:
35+
# Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset.
36+
python-version: '3.12'
37+
38+
- name: Install packages
39+
run: pip install -r ${{github.workspace}}/requirements.txt
40+
41+
- name: Configure CMake
42+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
43+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
44+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
45+
46+
- name: Lint
47+
run: python3 ${{github.workspace}}/tools/run_clang_tidy.py -source-filter='.*lib.*' -p ${{github.workspace}}/build

0 commit comments

Comments
 (0)