Skip to content

Commit 0e54e3e

Browse files
authored
Move e2e tests to a separate workflow (#522)
1 parent 3b2ebaf commit 0e54e3e

File tree

2 files changed

+102
-39
lines changed

2 files changed

+102
-39
lines changed

.github/workflows/e2e.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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

.github/workflows/test.yml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -117,51 +117,12 @@ jobs:
117117
# Only save cache from main branch to prevent cache proliferation
118118
save-if: ${{ github.ref == 'refs/heads/main' }}
119119

120-
- name: Build CLI
121-
run: cargo build -p pcb
122-
123120
- name: Test All (Workspace)
124121
env:
125122
RUST_LOG: debug
126123
RUST_BACKTRACE: full
127124
run: cargo test --verbose --workspace
128125

129-
- name: Build examples
130-
run: cargo run -- build examples
131-
132-
- name: Test CLI (E2E)
133-
env:
134-
RUST_LOG: info,pcb::release=debug,pcb::bom=debug
135-
run: |
136-
# Test workspace with pcb.toml and workspace-relative loads
137-
cargo run -- bom test-workspaces/with-pcb-toml/boards/WorkspaceTestBoard.zen
138-
cargo run -- layout test-workspaces/with-pcb-toml/boards/WorkspaceTestBoard.zen --no-open
139-
cargo run -- publish test-workspaces/with-pcb-toml/boards/WorkspaceTestBoard.zen -S layout.drc.invalid_outline
140-
141-
- name: Test pcb new (E2E)
142-
if: runner.os != 'Windows'
143-
run: |
144-
cd /tmp
145-
cargo run --manifest-path $GITHUB_WORKSPACE/Cargo.toml -- new --workspace test-ws --repo github.com/test/test-ws
146-
cd test-ws
147-
cargo run --manifest-path $GITHUB_WORKSPACE/Cargo.toml -- new --board TB0001
148-
cargo run --manifest-path $GITHUB_WORKSPACE/Cargo.toml -- new --package reference/ref_a
149-
cargo run --manifest-path $GITHUB_WORKSPACE/Cargo.toml -- new --package modules/mod_a
150-
cargo run --manifest-path $GITHUB_WORKSPACE/Cargo.toml -- build .
151-
cat .claude/skills/pcb/SKILL.md > /dev/null
152-
153-
- name: Checkout stdlib
154-
uses: actions/checkout@v5
155-
with:
156-
repository: diodeinc/stdlib
157-
path: stdlib
158-
159-
- name: Test stdlib builds
160-
shell: bash
161-
run: |
162-
$(pwd)/target/debug/pcb build stdlib
163-
echo "All stdlib files built successfully!"
164-
165126
python-tests:
166127
name: Python Tests
167128
runs-on: ubicloud-standard-4

0 commit comments

Comments
 (0)