topstitch 0.96.0

Stitch together Verilog modules with Rust
Documentation
# SPDX-License-Identifier: Apache-2.0

# adapted from https://github.com/xlsynth/xlsynth-crate/blob/main/.github/workflows/ci.yml

name: Rust CI

on:
  pull_request:
  workflow_dispatch:
  push:
    branches:
      - main

jobs:
  # -----------------------------------------------------------
  # 1) Lint-check / pre-commit gate
  # -----------------------------------------------------------
  lint-check:
    runs-on: ubuntu-latest

    steps:
      - name: Check out code
        uses: actions/checkout@v3

      - name: Set up Python + pre-commit
        run: |
          python -m pip install --upgrade pip
          pip install pre-commit

      - name: Run pre-commit
        env:
          SKIP: no-commit-to-branch
        run: |
          pre-commit install
          pre-commit run --all-files

  # -----------------------------------------------------------
  # 2) Build/test
  # -----------------------------------------------------------
  build-and-test:
    needs: [lint-check]  # Ensure lint checks pass first
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-24.04]  # TODO: add more OSes in the future
      fail-fast: false

    steps:
      - name: Check out code
        uses: actions/checkout@v3

      - name: Download Slang
        run: |
          curl -L -o slang "https://github.com/xlsynth/slang-rs/releases/download/ci/slang"
          chmod +x slang

      - name: Set up Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: Install libc++ runtime
        run: |
          sudo apt-get update
          sudo apt-get install -y libc++1 libc++abi1 || \
          sudo apt-get install -y libc++1-18 libc++abi1-18 || \
          sudo apt-get install -y libc++1-14 libc++abi1-14

      - name: Run tests
        run: export SLANG_PATH=`realpath slang` && cargo test