Skip to content

Deprecate [assets] and add built-in resolution of KiCad-style asset repositories #2191

Deprecate [assets] and add built-in resolution of KiCad-style asset repositories

Deprecate [assets] and add built-in resolution of KiCad-style asset repositories #2191

Workflow file for this run

name: Build and Test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_PROFILE_TEST_DEBUG: 0
KICAD_VERSION: 9.0.7 # Update container image below when changing this
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint and Check
runs-on: ubicloud-standard-16-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Check All
run: cargo check --workspace --all
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --workspace -- -D warnings
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Type check Python with ty
run: uv sync && uvx ty check
test:
name: Test (${{ matrix.config.name }})
runs-on: ${{ matrix.config.runs-on }}
container: ${{ matrix.config.container }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
config:
- name: Windows
runs-on: diode-windows
- name: macOS
runs-on: macos-15-xlarge
- name: Ubuntu
runs-on: ubicloud-standard-30-ubuntu-2204
container:
image: ghcr.io/diodeinc/kicad:9.0.7-trixie-full # Keep in sync with KICAD_VERSION
options: --user root
steps:
- uses: actions/checkout@v5
- name: Install Dependencies (Ubuntu)
if: matrix.config.name == 'Ubuntu'
run: |
apt-get update
apt-get install -y curl build-essential pkg-config libssl-dev
- name: Cache KiCad (macOS)
if: contains(matrix.config.name, 'macOS')
id: cache-kicad-mac
uses: actions/cache@v4
with:
path: /Applications/KiCad
key: ${{ runner.os }}-kicad-${{ env.KICAD_VERSION }}
- name: Install KiCad (macOS)
if: contains(matrix.config.name, 'macOS') && steps.cache-kicad-mac.outputs.cache-hit != 'true'
run: |
brew update
# Uninstall existing KiCad if present to avoid conflicts
brew uninstall --cask kicad 2>/dev/null || true
# Remove any remaining KiCad installation
rm -rf /Applications/KiCad 2>/dev/null || true
# Install KiCad fresh
brew install --cask kicad
- name: Install KiCad (Windows)
if: matrix.config.name == 'Windows' && steps.cache-kicad-windows.outputs.cache-hit != 'true'
run: |
choco install kicad --version ${{ env.KICAD_VERSION }} -y
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
# Only save cache from main branch to prevent cache proliferation
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Test All (Workspace)
env:
RUST_LOG: debug
RUST_BACKTRACE: full
run: cargo nextest run --workspace --profile ci --locked
- name: Run doctests
env:
RUST_LOG: debug
RUST_BACKTRACE: full
run: cargo test --doc --workspace --locked
python-tests:
name: Python Tests
runs-on: ubicloud-standard-4
timeout-minutes: 10
defaults:
run:
working-directory: crates/pcb-layout/src/scripts
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v5
- run: uv sync
working-directory: .
- run: uv run ruff check .
- run: uv run ruff format --check .
- run: uv run pytest lens/tests -v
check_readme:
name: Check README Sync
runs-on: ubicloud-standard-2
steps:
- uses: actions/checkout@v5
- name: Check README sync
run: bin/embed-readme --check README.md