Dependency image refactor #337
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: | ||
concurrency: | ||
group: linter-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
waitForDependencyImage: | ||
name: Wait for dependency image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Wait | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.ref }} | ||
check-name: 'Build Docker Image Dependencies' | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 3 | ||
linter: | ||
name: Build And Run linter | ||
needs: waitForDependencyImage | ||
runs-on: ubuntu-latest | ||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
DOCKER_DEPENDENCY_IMAGE_NAME: ghcr.io/genspectrum/lapis-silo-dependencies | ||
container: | ||
image: ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:commit-${{ github.sha }} | ||
Check failure on line 31 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 |