From 2ac0e059d53d11d8e09a056f36efb162c28a2409 Mon Sep 17 00:00:00 2001 From: Shane Sewell <2242776+ssewell@users.noreply.github.com> Date: Sun, 20 Aug 2023 13:05:35 -0500 Subject: [PATCH] Update KLC Compliance Check to only include changed files --- .github/workflows/kicad-klc-check.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kicad-klc-check.yml b/.github/workflows/kicad-klc-check.yml index ddce0e1..309a86b 100644 --- a/.github/workflows/kicad-klc-check.yml +++ b/.github/workflows/kicad-klc-check.yml @@ -29,5 +29,20 @@ jobs: with: python-version: '3.10.11' - - name: Run KiCad KLC Footprint Check - run: python ./library-utils/klc-check/check_footprint.py ./SimPanel.pretty/* -vv \ No newline at end of file + # We use this to limit KLC checking to only changed files + - uses: jitterbit/get-changed-files@v1 + with: + format: 'json' + + - id: footprint_files + name: Run KiCad KLC Footprint Check + uses: jitterbit/get-changed-files@v1 + with: + format: 'json' + - run: | + readarray -t changed_files <<<"$(jq -r '.[]' <<<'${{ steps.footprint_files.outputs.added_modified }}')" + for changed_file in ${changed_files[@]}; do + if [[ ${changed_file} == *.kicad_mod ]]; then + python ./library-utils/klc-check/check_footprint.py ./SimPanel.pretty/${changed_file} -vv + fi + done \ No newline at end of file