Use newline separator, use develop branch as reference if not a pull … #277
Workflow file for this run
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: 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_pull_request: | |
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: | |
files: | | |
**/*.fzp | |
**/*.svg | |
files_ignore: | | |
**/obsolete/** | |
write_output_files: true | |
separator: "\n" | |
- 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: | |
files: | | |
**/*.fzp | |
**/*.svg | |
files_ignore: | | |
**/obsolete/** | |
write_output_files: true | |
separator: "\n" | |
since: "develop" | |
- 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 |