Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes in github actions for clang-tidy and clang-format #611

Merged
merged 2 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Checks: >
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
value: aNy_CasE
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this because clad::array and clad::matrix are small cases but Visitors are capital cases.

- key: readability-identifier-naming.FunctionCase
value: aNy_CasE
- key: readability-identifier-naming.MemberCase
value: CamelCase
value: aNy_CasE
- key: readability-identifier-naming.ParameterCase
value: aNy_CasE
- key: readability-identifier-naming.UnionCase
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,6 @@ concurrency:
cancel-in-progress: true

jobs:
precheckin:
runs-on: ubuntu-22.04
steps:
- name: Checkout PR branch
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install clang-format
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install -y clang-format-15
- name: Download git-clang-format
run: |
wget https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/git-clang-format
chmod +x git-clang-format
- name: Run git-clang-format
run: |
PR_BASE=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1)
echo "running git clang-format against $PR_BASE commit"
git \
-c color.ui=always \
-c diff.wsErrorHighlight=all \
-c color.diff.whitespace='red reverse' \
clang-format-15 --diff --binary clang-format-15 --commit $PR_BASE -- demos/ include/ lib/ tools/ || \
(echo "Please run the following git-clang-format locally to fix the formatting: \n
git clang-format origin/master -- demos/ include/ lib/ tools/" && exit 1)
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: clang-format

on:
pull_request:
paths:
- '**.h'
- '**.cpp'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
precheckin:
runs-on: ubuntu-22.04
steps:
- name: Checkout PR branch
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install clang-format
run: |
curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" | sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install -y clang-format-15
- name: Download git-clang-format
run: |
wget https://raw.githubusercontent.com/llvm/llvm-project/main/clang/tools/clang-format/git-clang-format
chmod +x git-clang-format
- name: Run git-clang-format
run: |
PR_BASE=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1)
echo "running git clang-format against $PR_BASE commit"
git \
-c color.ui=always \
-c diff.wsErrorHighlight=all \
-c color.diff.whitespace='red reverse' \
clang-format-15 --diff --binary clang-format-15 --commit $PR_BASE -- demos/ include/ lib/ tools/ || \
(echo "Please run the following git-clang-format locally to fix the formatting: \n
git clang-format origin/master -- demos/ include/ lib/ tools/" && exit 1)
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy-review-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- name: Post review comments
id: post-review
uses: ZedThree/clang-tidy-review/post@v0.13.1
uses: ZedThree/clang-tidy-review/post@v0.13.2
with:
max_comments: 10

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
version: "12.0.0"

- name: Run clang-tidy
uses: ZedThree/clang-tidy-review@v0.13.1
uses: ZedThree/clang-tidy-review@v0.13.2
id: review
with:
build_dir: build
exclude: "test/*"
exclude: "test/*,benchmark/*"
split_workflow: true
cmake_command: >
pip install cmake lit &&
Expand Down
Loading