-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (52 loc) · 1.56 KB
/
kiri-diff.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types:
- opened
- synchronize
name: Kiri Diff
jobs:
get-changed-files:
name: Get changed files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get changed PCB files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**/*.kicad_pcb
**/*.kicad_sch
dir_names: true
matrix: true
outputs:
any-changed: ${{ steps.changed-files.outputs.any_changed }}
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
kiri-diff:
if: ${{ fromJson(needs.get-changed-files.outputs.any-changed) }}
needs: get-changed-files
strategy:
matrix:
file: ${{ fromJSON(needs.get-changed-files.outputs.matrix) }}
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Get KiCad Project File
id: kicad-project-file
run: |
PROJECT_NAME="$(basename "${{ matrix.file }}")"
PROJECT_FILE="${{ matrix.file }}/${PROJECT_NAME}.kicad_pro"
echo "project-file=$PROJECT_FILE" >> "$GITHUB_OUTPUT"
- name: Kiri
uses: usa-reddragon/kiri-github-action@v1
with:
project-file: ${{ steps.kicad-project-file.outputs.project-file }}