-
Notifications
You must be signed in to change notification settings - Fork 359
129 lines (123 loc) · 4.14 KB
/
ci.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: check-all-parts
on: [push, pull_request]
jobs:
python-scripts:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install requirements
run: pip install -r scripts/requirements.txt
- name: Avoid non-ASCII in part and SVG filenames
run: python scripts/checkascii.py .
- name: Check that image filenames use same case
run: python scripts/checkcase.py
- name: Look for suspicious connector numbering
run: python scripts/connectors_misnumbered.py -d .
- name: Avoid duplicate files
run: python scripts/checkcopies.py -d svg
- name: Dry run script to test the script itself
run: python scripts/obsolete.py core/sparkfun-connectors-rca-.fzp dummy -s
- name: Check that SVGs have proper layer ids
run: python scripts/svgNoLayer.py -d svg/core -s scripts/nolayeridcheck.txt
- name: Check that SVGs and FZPs are ASCII or UTF-8
run: python scripts/utf8stats.py . --verbose
golang-scripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19.5
- name: Install fzp tool
run: |
go install github.com/fritzing/fzp/bin/fzp@latest
fzp -v
go install github.com/fritzing/fzb/bin/fzb@latest
fzb -version
- name: Fzp validate
run: fzp validate --dir ./core
check_modified_files_merge:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install requirements
run: pip install --no-cache-dir -r scripts/checks/requirements.txt
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
files: |
**/*.fzp
**/*.svg
files_ignore: |
**/obsolete/**
write_output_files: true
- name: List changed files
run: cat .github/outputs/all_changed_files.txt
- name: Run fzp checker
run: python scripts/checks/fzp_checker_runner.py . -f .github/outputs/all_changed_files.txt -v
check_modified_files_default:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install requirements
run: pip install --no-cache-dir -r scripts/checks/requirements.txt
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
since_last_remote_commit: true
files: |
**/*.fzp
**/*.svg
files_ignore: |
**/obsolete/**
write_output_files: true
- name: List changed files
run: cat .github/outputs/all_changed_files.txt
- name: Run fzp checker
run: python scripts/checks/fzp_checker_runner.py . -f .github/outputs/all_changed_files.txt -v
checker_unit_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install requirements
run: |
cd scripts/checks
pip install --no-cache-dir -r requirements.txt
- name: Run pytest
run: python -m pytest
working-directory: scripts/checks