|
| 1 | +name: E2E CLI Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +env: |
| 10 | + CARGO_TERM_COLOR: always |
| 11 | + KICAD_VERSION: 9.0.7 |
| 12 | + |
| 13 | +concurrency: |
| 14 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + |
| 17 | +jobs: |
| 18 | + e2e: |
| 19 | + name: E2E (${{ matrix.config.name }}) |
| 20 | + runs-on: ${{ matrix.config.runs-on }} |
| 21 | + container: ${{ matrix.config.container }} |
| 22 | + timeout-minutes: 20 |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + config: |
| 27 | + - name: macOS |
| 28 | + runs-on: macos-15-xlarge |
| 29 | + - name: Ubuntu |
| 30 | + runs-on: ubicloud-standard-30-ubuntu-2204 |
| 31 | + container: |
| 32 | + image: ghcr.io/diodeinc/kicad:9.0.7-trixie-full |
| 33 | + options: --user root |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v5 |
| 36 | + |
| 37 | + - name: Install Dependencies (Ubuntu) |
| 38 | + if: matrix.config.name == 'Ubuntu' |
| 39 | + run: | |
| 40 | + apt-get update |
| 41 | + apt-get install -y curl build-essential pkg-config libssl-dev |
| 42 | +
|
| 43 | + - name: Cache KiCad (macOS) |
| 44 | + if: matrix.config.name == 'macOS' |
| 45 | + id: cache-kicad-mac |
| 46 | + uses: actions/cache@v4 |
| 47 | + with: |
| 48 | + path: /Applications/KiCad |
| 49 | + key: ${{ runner.os }}-kicad-${{ env.KICAD_VERSION }} |
| 50 | + |
| 51 | + - name: Install KiCad (macOS) |
| 52 | + if: matrix.config.name == 'macOS' && steps.cache-kicad-mac.outputs.cache-hit != 'true' |
| 53 | + run: | |
| 54 | + brew update |
| 55 | + brew uninstall --cask kicad 2>/dev/null || true |
| 56 | + rm -rf /Applications/KiCad 2>/dev/null || true |
| 57 | + brew install --cask kicad |
| 58 | +
|
| 59 | + - name: Install Rust |
| 60 | + uses: dtolnay/rust-toolchain@stable |
| 61 | + |
| 62 | + - name: Cache Cargo |
| 63 | + uses: Swatinem/rust-cache@v2 |
| 64 | + with: |
| 65 | + save-if: ${{ github.ref == 'refs/heads/main' }} |
| 66 | + |
| 67 | + - name: Build and install pcb CLI |
| 68 | + run: | |
| 69 | + cargo build --release -p pcb |
| 70 | + cp target/release/pcb ~/.cargo/bin/pcb |
| 71 | + pcb --help |
| 72 | +
|
| 73 | + - name: Build examples |
| 74 | + run: pcb build examples |
| 75 | + |
| 76 | + - name: Test workspace with pcb.toml |
| 77 | + env: |
| 78 | + RUST_LOG: info,pcb::release=debug,pcb::bom=debug |
| 79 | + run: | |
| 80 | + pcb bom test-workspaces/with-pcb-toml/boards/WorkspaceTestBoard.zen |
| 81 | + pcb layout test-workspaces/with-pcb-toml/boards/WorkspaceTestBoard.zen --no-open |
| 82 | + pcb publish test-workspaces/with-pcb-toml/boards/WorkspaceTestBoard.zen -S layout.drc.invalid_outline |
| 83 | +
|
| 84 | + - name: Test pcb new |
| 85 | + run: | |
| 86 | + cd /tmp |
| 87 | + pcb new --workspace test-ws --repo github.com/test/test-ws |
| 88 | + cd test-ws |
| 89 | + pcb new --board TB0001 |
| 90 | + pcb new --package reference/ref_a |
| 91 | + pcb new --package modules/mod_a |
| 92 | + pcb build . |
| 93 | + cat .claude/skills/pcb/SKILL.md > /dev/null |
| 94 | +
|
| 95 | + - name: Checkout stdlib |
| 96 | + uses: actions/checkout@v5 |
| 97 | + with: |
| 98 | + repository: diodeinc/stdlib |
| 99 | + path: stdlib |
| 100 | + |
| 101 | + - name: Test stdlib builds |
| 102 | + run: pcb build stdlib |
0 commit comments