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

chore: run clang-tidy (linter) on all files when on main or manually triggered #504

Merged
merged 1 commit into from
Jan 29, 2025
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
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,25 @@ jobs:
cmake --build build/Debug --target ${file%.cpp}.o
fi
done

linterAll:
name: Build/Run linter on all files
needs: dockerImage
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'trigger-linter')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Determine HEAD_SHA
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
else
echo "HEAD_SHA=${{ github.sha }}" >> $GITHUB_ENV
fi

- shell: bash
name: Build all files with clang-tidy
run: |
docker build -f ./Dockerfile_linter \
--build-arg DEPENDENCY_IMAGE=ghcr.io/genspectrum/lapis-silo-dependencies:commit-${{ env.HEAD_SHA }}-amd64 .
2 changes: 1 addition & 1 deletion Dockerfile_linter
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ WORKDIR /src
COPY . ./

RUN cmake -D BUILD_WITH_CLANG_TIDY=ON -D CMAKE_BUILD_TYPE=Debug -B build/Debug
RUN cmake --build build/Debug
RUN cmake --build build/Debug --parallel $THREADS
Loading