Dependency image refactor #334
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Linter | ||
on: | ||
pull_request: | ||
workflow_run: | ||
workflows: [ "First Workflow" ] | ||
types: | ||
- completed | ||
concurrency: | ||
group: linter-${{ github.ref }} | ||
cancel-in-progress: true | ||
env: | ||
DOCKER_DEPENDENCY_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo-dependencies | ||
jobs: | ||
linter: | ||
name: Build And Run linter | ||
needs: linterDependencies | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event_name == 'pull_request' }} | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
container: | ||
image: ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ github.sha }} | ||
Check failure on line 26 in .github/workflows/linter.yml GitHub Actions / Run LinterInvalid workflow file
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- shell: bash | ||
name: Configure and run clang-tidy on changed files | ||
run: | | ||
mv /src/build . | ||
cmake -DBUILD_WITH_CLANG_TIDY=on -D CMAKE_BUILD_TYPE=Debug -B build/Debug | ||
echo "Successfully configured cmake" | ||
files="" | ||
PAGE=1 | ||
while true; do | ||
page_files=$(curl -s \ | ||
"https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}/files?per_page=100&page=$PAGE" \ | ||
| jq -r '.[] | select(.status != "removed") | .filename') | ||
# If there are no more files, break the loop | ||
if [[ -z "$page_files" ]]; then | ||
break | ||
fi | ||
files+="$page_files"$'\n' | ||
PAGE=$((PAGE + 1)) | ||
done | ||
echo "Changed files of this PR:" | ||
echo "$files" | ||
IFS=$'\n' | ||
for file in $files; do | ||
echo "Check ending for file: $file" | ||
if [[ $file == *.cpp ]]; then | ||
echo "Now linting the file: $file" | ||
echo "cmake --build build/Debug --target ${file%.cpp}.o" | ||
cmake --build build/Debug --target ${file%.cpp}.o | ||
fi | ||
done |