Skip to content

Commit

Permalink
Add clang-tidy workflow (#3403)
Browse files Browse the repository at this point in the history
  • Loading branch information
externl authored Jan 22, 2025
1 parent fd9f9c8 commit c3c0fe9
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test
name: CI

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate API Coverage
name: Coverage

on:
workflow_dispatch:
Expand Down
38 changes: 36 additions & 2 deletions .github/workflows/clang_format.yml → .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Clang Format

name: C++
on:
workflow_dispatch:
push:
Expand Down Expand Up @@ -30,3 +29,38 @@ jobs:
run: |
find . -name "*.h" -o -name "*.c" -o -name "*.cpp" -o -name "*.mm" | xargs clang-format-19 --style=file --fallback-style=none --Werror --dry-run
find cpp -name "*.m" | xargs clang-format-19 --style=file --fallback-style=none --Werror --dry-run
clang-tidy:
runs-on: ubuntu-latest
steps:
- name: Install clang-tidy
run: |
# This LLVM script will add the relevant LLVM PPA: https://apt.llvm.org/
wget https://apt.llvm.org/llvm.sh -O /tmp/llvm.sh
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh 19
sudo apt-get install -y clang-tidy-19
rm /tmp/llvm.sh
clang-tidy-19 --version
- name: Install bear
run: |
sudo apt-get update
sudo apt-get install -y bear
bear --version
- name: Checkout Ice
uses: actions/checkout@v4

- name: Setup Ice Build Dependencies
uses: ./.github/actions/setup-dependencies

- name: Build Ice
timeout-minutes: 90
working-directory: cpp
run: bear -- make srcs

- name: Run Clang Tidy
working-directory: cpp
run: |
run-clang-tidy-19 -j$(nproc) -quiet src/Ice
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generate API Reference
name: Documentation

on:
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: dotnet format
name: .NET

on:
workflow_dispatch:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: JavaScript Prettier
name: JavaScript

on:
push:
Expand All @@ -8,7 +8,7 @@ on:
branches: ["main"]

jobs:
js-prettier:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -17,7 +17,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'latest'
node-version: "latest"

- name: Run JavaScript prettier
run: npx prettier --check .
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Matlab Analyzer
name: Matlab

on:
workflow_dispatch:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ruff.yml → .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python lint and format
name: Python

on:
workflow_dispatch:
Expand All @@ -9,7 +9,7 @@ on:
branches: ["main"]

jobs:
ruff-lint:
ruff:
name: Ruff check
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Swift Format
name: Swift

on:
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/whitespace.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Whitespace validation
name: Whitespace

on:
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ passwords

# Makefile Build System
build
!.github/actions/build
generated
.depend

Expand Down

0 comments on commit c3c0fe9

Please sign in to comment.