Files
diodeinc__pcb/.github/workflows/test.yml
dependabot[bot] 0ff4483978 Bump the github-actions group across 1 directory with 4 updates
Bumps the github-actions group with 4 updates in the / directory: [actions-rust-lang/setup-rust-toolchain](https://github.com/actions-rust-lang/setup-rust-toolchain), [taiki-e/install-action](https://github.com/taiki-e/install-action), [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) and [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action).


Updates `actions-rust-lang/setup-rust-toolchain` from 1.17.0 to 2.0.0
- [Release notes](https://github.com/actions-rust-lang/setup-rust-toolchain/releases)
- [Changelog](https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions-rust-lang/setup-rust-toolchain/compare/166cdcfd11aee3cb47222f9ddb555ce30ddb9659...ecabd13d1c56bd1345c230e542e9144811ad706f)

Updates `taiki-e/install-action` from 2.87.2 to 2.87.8
- [Release notes](https://github.com/taiki-e/install-action/releases)
- [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/install-action/compare/1ed6d7be6168f6c9046541087ff549b6bc581fdf...d438492cf8a250514fa2d34b30bc3c0dc37c65ff)

Updates `aws-actions/configure-aws-credentials` from 6.2.3 to 6.2.4
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/e6de054238d6b7531b4efff3b6587d9aade6a06c...cbe3b392738ccf3f987d68400dafcf4b0624a56c)

Updates `zizmorcore/zizmor-action` from 0.6.2 to 0.6.3
- [Release notes](https://github.com/zizmorcore/zizmor-action/releases)
- [Commits](https://github.com/zizmorcore/zizmor-action/compare/3dc1ecc9bcb9e94e9b2c709687979e1298497054...70fb788f84895a7701f5643d103d587e460b5c99)

---
updated-dependencies:
- dependency-name: actions-rust-lang/setup-rust-toolchain
  dependency-version: 2.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: taiki-e/install-action
  dependency-version: 2.87.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: 6.2.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: zizmorcore/zizmor-action
  dependency-version: 0.6.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-09-14 03:19:00 +00:00

203 lines
6.6 KiB
YAML

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: 10.0.5
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
packages: read
jobs:
lint:
name: Lint and Check
runs-on: blacksmith-16vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
with:
components: rustfmt, clippy
cache-bin: false
- name: Check formatting
run: cargo fmt --all -- --check
- name: Check stdlib .zen formatting
run: cargo run -p pcbc -- fmt --check lib/std
- name: Run Clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
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: blacksmith-16vcpu-windows-2025
- name: macOS
runs-on: blacksmith-6vcpu-macos-15
- name: Ubuntu
runs-on: blacksmith-16vcpu-ubuntu-2404
container:
image: ghcr.io/diodeinc/kicad:10.0.5
options: --user root
steps:
- name: Enable Windows long paths
if: runner.os == 'Windows'
run: git config --global core.longpaths true
- name: Cache APT packages (Ubuntu)
if: matrix.config.name == 'Ubuntu'
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /tmp/apt-cache/archives
key: apt-${{ runner.os }}-${{ runner.arch }}-debian-trixie-${{ env.KICAD_VERSION }}-ca-certificates-curl-build-essential-pkg-config
restore-keys: |
apt-${{ runner.os }}-${{ runner.arch }}-debian-trixie-${{ env.KICAD_VERSION }}-
- name: Install Dependencies (Ubuntu)
if: matrix.config.name == 'Ubuntu'
run: |
apt_cache_dir=/tmp/apt-cache/archives
mkdir -p "$apt_cache_dir/partial"
apt-get -o Dir::Cache::archives="$apt_cache_dir/" update
apt-get -o Dir::Cache::archives="$apt_cache_dir/" install -y --no-install-recommends ca-certificates curl build-essential pkg-config
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Cache KiCad (macOS)
if: contains(matrix.config.name, 'macOS')
id: cache-kicad-mac
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
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
brew uninstall --cask kicad 2>/dev/null || true
rm -rf /Applications/KiCad 2>/dev/null || true
brew install --cask kicad
- name: Cache KiCad (Windows)
if: matrix.config.name == 'Windows'
id: cache-kicad-windows
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: C:\Program Files\KiCad\10.0
key: ${{ runner.os }}-kicad-${{ env.KICAD_VERSION }}
- name: Install KiCad (Windows)
if: matrix.config.name == 'Windows' && steps.cache-kicad-windows.outputs.cache-hit != 'true'
shell: pwsh
run: |
$release = Invoke-RestMethod `
-Uri "https://api.github.com/repos/KiCad/kicad-source-mirror/releases/tags/${env:KICAD_VERSION}"
$asset = $release.assets |
Where-Object { $_.name -like "kicad-$env:KICAD_VERSION*-x86_64.exe" } |
Select-Object -First 1
if (-not $asset) {
throw "No KiCad Windows installer found for release tag $env:KICAD_VERSION"
}
$installer = Join-Path $env:RUNNER_TEMP $asset.name
Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $installer
Start-Process -FilePath $installer -ArgumentList '/S', '/allusers' -Wait
- name: Verify KiCad installation (Windows)
if: matrix.config.name == 'Windows'
shell: pwsh
run: |
if (-not (Test-Path "C:\Program Files\KiCad\10.0\bin\kicad-cli.exe")) {
throw "KiCad CLI was not restored or installed"
}
- name: Install Rust (Windows)
if: runner.os == 'Windows'
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
with:
rustflags: ""
cache-bin: false
- name: Install Rust
if: runner.os != 'Windows'
uses: actions-rust-lang/setup-rust-toolchain@ecabd13d1c56bd1345c230e542e9144811ad706f # v2.0.0
with:
cache-bin: false
- name: Install nextest
uses: taiki-e/install-action@d438492cf8a250514fa2d34b30bc3c0dc37c65ff # v2.87.8
with:
tool: 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: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 10
defaults:
run:
working-directory: crates/pcb-layout/src/scripts
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@20cfd1bf945f4377ade1205e4dbc17946fc9a30d # v10.0.1
- run: uv sync --locked
working-directory: .
- run: uv run --locked ty check
working-directory: .
- run: uv run --locked ruff check .
- run: uv run --locked ruff format --check .
- run: uv run --locked pytest lens/tests -v
check_readme:
name: Check README Sync
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check README sync
run: bin/embed-readme --check README.md