Add GitHub Actions workflows for PR checks and hardware release #15
Workflow file for this run
This file contains hidden or 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: KM217-WiFi Build & Documentation Check | |
| on: | |
| pull_request: | |
| branches: [ main, develop ] | |
| paths: | |
| - 'KM217-WiFi/**' | |
| - 'EXTENSIONS/ETH_W5500/**' | |
| - 'DOC/**' | |
| - '.github/workflows/pr-check.yml' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| hardware-build: | |
| name: 🔧 Hardware Build & Export | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/the78mole/kicaddev-docker:latest | |
| strategy: | |
| matrix: | |
| project: | |
| - name: "KM217-WiFi" | |
| path: "KM217-WiFi" | |
| description: "Main KM217-WiFi Board" | |
| - name: "ETH_W5500" | |
| path: "EXTENSIONS/ETH_W5500" | |
| description: "Ethernet Extension Board" | |
| fail-fast: false | |
| steps: | |
| - name: 📥 Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🏷️ Generate Semantic Version | |
| id: version | |
| uses: paulhatch/[email protected] | |
| with: | |
| tag_prefix: "" | |
| major_pattern: "BREAKING CHANGE:" | |
| minor_pattern: "feat:" | |
| version_format: "${major}.${minor}.${patch}" | |
| bump_each_commit: false | |
| search_commit_body: true | |
| - name: 🔍 Check for KiCad Changes Since Last Release | |
| id: check-changes | |
| run: | | |
| ./.github/workflows/scripts/check-kicad-changes-since-release.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 🔄 Update KiCad Revision | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/update-kicad-revision.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" \ | |
| "${{ steps.version.outputs.version }}" \ | |
| "${{ github.event.pull_request.number }}" | |
| - name: 🔍 Check KiCad Project Files | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/check-kicad-files-with-revision.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 🧹 Clean Export Directory | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/clean-export-dirs.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 📐 Export Schematics PDF | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/export-schematics.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 🔧 Export Gerber Files | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/export-gerber.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 📄 Export PCB PDF | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/export-pcb-pdf.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 🖼️ Export PCB Images | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/export-pcb-images.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 🎯 Export 3D Models | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/export-3d-models.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 📊 Generate Production Summary | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/generate-production-summary-pr.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" \ | |
| "${GITHUB_SHA}" | |
| - name: 🧪 Validate Export Files | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| run: | | |
| ./.github/workflows/scripts/validate-export-files.sh \ | |
| "${{ matrix.project.name }}" \ | |
| "${{ matrix.project.path }}" \ | |
| "${{ matrix.project.description }}" | |
| - name: 📤 Upload Hardware Artifacts | |
| if: steps.check-changes.outputs.CHANGED == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.project.name }}-hardware-exports | |
| path: | | |
| ${{ matrix.project.path }}/Export/ | |
| retention-days: 30 | |
| - name: 📤 Upload Revision Status | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.project.name }}-revision-status | |
| path: | | |
| revision-status/${{ matrix.project.name }}-revision.txt | |
| retention-days: 30 | |
| if-no-files-found: ignore | |
| - name: 📤 Upload Change Status | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.project.name }}-change-status | |
| path: | | |
| change-status/${{ matrix.project.name }}-changes.txt | |
| retention-days: 30 | |
| if-no-files-found: ignore | |
| documentation-build: | |
| name: 📚 Documentation Build | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/the78mole/kicaddev-docker:latest | |
| steps: | |
| - name: 📥 Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: 🔍 Check Documentation Files | |
| run: ./.github/workflows/scripts/check-documentation.sh | |
| - name: 📖 Build AsciiDoc Documentation | |
| run: ./.github/workflows/scripts/build-asciidoc.sh | |
| - name: 📝 Generate LaTeX Documentation | |
| run: ./.github/workflows/scripts/build-latex.sh | |
| - name: 🔗 Check Documentation Links | |
| run: ./.github/workflows/scripts/check-documentation-links.sh | |
| - name: 📊 Documentation Statistics | |
| run: ./.github/workflows/scripts/generate-documentation-statistics.sh | |
| - name: 📤 Upload Documentation Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: km217-wifi-documentation | |
| path: | | |
| DOC/ | |
| retention-days: 30 | |
| pr-summary: | |
| name: 📋 PR Summary | |
| runs-on: ubuntu-latest | |
| needs: [hardware-build, documentation-build] | |
| if: ${{ github.event_name == 'pull_request' }} | |
| steps: | |
| - name: 📥 Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: 📥 Download Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts/ | |
| - name: 📊 Generate PR Summary | |
| run: ./.github/workflows/scripts/generate-pr-summary.sh | |
| - name: 💬 Comment PR Summary | |
| uses: actions/github-script@v7 | |
| if: github.event_name == 'pull_request' && !env.ACT | |
| with: | |
| script: | | |
| const fs = require('fs'); | |
| const summary = fs.readFileSync('pr_summary.md', 'utf8'); | |
| github.rest.issues.createComment({ | |
| issue_number: context.issue.number, | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: summary | |
| }); | |
| - name: 🧪 Local Test Summary (act only) | |
| if: env.ACT == 'true' | |
| run: ./.github/workflows/scripts/local-pr-test-summary.sh |