From 35de434768dbd15c181fb0158971ced40c48d643 Mon Sep 17 00:00:00 2001 From: Alexander Taepper Date: Tue, 14 Jan 2025 17:37:35 +0100 Subject: [PATCH] build: run linter on all files on main --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ Dockerfile_linter | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce8c8f0c6..92ecf017f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 . diff --git a/Dockerfile_linter b/Dockerfile_linter index 8dd5979f4..cc27a51ea 100644 --- a/Dockerfile_linter +++ b/Dockerfile_linter @@ -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