Skip to content

Commit

Permalink
ci: updated workflow script for changes only
Browse files Browse the repository at this point in the history
CI now only checks changed files in PR

Signed-off-by: Kelly Helmut Lord <[email protected]>
  • Loading branch information
hlord2000 committed Dec 9, 2023
1 parent 120691b commit caf9594
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,42 @@ jobs:
echo "Violation found in script output"
exit 1
fi
jobs:
kicad-check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Ensures history is available for diff
submodules: 'recursive'

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Specify Python version

- name: Run KiCad Library Checks
run: |
git fetch origin main:main
violations_found=false
for file in $(git diff --name-only main...HEAD -- ./symbols ./footprints); do
if [[ "$file" == *.kicad_sym ]]; then
output=$(./kicad-library-utils/klc-check/check_symbol.py "$file" -vv)
elif [[ "$file" == *"/footprints/"* ]]; then
output=$(./kicad-library-utils/klc-check/check_footprint.py "$file" -vv)
fi
echo "$output"
if [[ "$output" == *"Violating"* ]]; then
if [[ "$output" != *"Violating S4.3"* ]] || [[ "$output" =~ "Violating"(.*)"Violating S4.3" ]]; then
violations_found=true
fi
fi
done
if [ "$violations_found" = true ] ; then
echo "Error: Violation detected other than 'Violating S4.3'"
exit 1
fi

0 comments on commit caf9594

Please sign in to comment.