Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
name: pytest-coverage-comment
on:
pull_request:
branches:
- '*'

# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
# `contents` is for permission to the contents of the repository.
Expand All @@ -18,16 +16,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/checkout@v4

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
cache: true

- name: Install dependencies
run: |
pdm install
- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v3

- name: Build coverage file
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ jobs:
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.12
cache: true

- name: Install dependencies
Expand Down
83 changes: 10 additions & 73 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ jobs:
fetch-depth: 0
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- name: Install dependencies
run: |
pdm install
with:
cache: true

- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v3

- name: Run tests
run: |
pdm run test
Expand All @@ -39,75 +42,9 @@ jobs:
with:
fetch-depth: 0
- name: Check source code licenses
run: |
docker run --platform=linux/amd64 -v ${PWD}:/src ghcr.io/google/addlicense -v -check -l BSD-2-Clause -c "ChipFlow" -s=only -ignore **/__init__.py **/*.py
run: ./tools/license_check.sh

test-submit:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: chipflow-lib
- name: Check out chipflow-examples
uses: actions/checkout@v4
with:
repository: ChipFlow/chipflow-examples
fetch-depth: 0
path: chipflow-examples

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
cache: true
cache-dependency-path: "./**/pyproject.toml"
- name: Install dependencies
working-directory: ./chipflow-examples
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m pip install -e ../chipflow-lib
- name: Run tests
working-directory: ./chipflow-examples/minimal
run: |
pdm test
pdm run chipflow pin lock
pdm run chipflow silicon submit --wait
env:
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}

test-submit-dry:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: chipflow-lib
- name: Check out chipflow-examples
uses: actions/checkout@v4
with:
repository: ChipFlow/chipflow-examples
fetch-depth: 0
path: chipflow-examples

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: "3.10"
cache: true
cache-dependency-path: "./**/pyproject.toml"
- name: Install dependencies
working-directory: ./chipflow-examples
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m pip install -e ../chipflow-lib
- name: Run tests
working-directory: ./chipflow-examples/minimal
run: |
pdm test
pdm run chipflow pin lock
pdm run chipflow silicon submit --dry-run
uses: ./.github/workflows/test-examples.yml
secrets:
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
5 changes: 2 additions & 3 deletions .github/workflows/preview-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ jobs:
- name: Setup PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: 3.12
cache: true

- name: Install dependencies
run: pdm install
- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v3

- name: Build docs
run: pdm docs
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Reusable workflow to test everything in chipflow-examples works

on:
workflow_call:
secrets:
CHIPFLOW_API_KEY:
required: true

jobs:
test-submit:
runs-on: ubuntu-latest
strategy:
matrix:
dry: [true, false]
repo:
- name: "ChipFlow/chipflow-examples"
design: "minimal"
env:
DRY: ${{ matrix.dry && '--dry-run' || '' }}
is_dry: ${{ matrix.dry && '(dry run)' || '' }}
our_path: "${{ github.workspace}}/${{ github.repo }}"
test_repo_path: "${{ github.workspace }}/${{ matrix.repo.name }}"

name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}

steps:
- name: Check out source code
uses: actions/checkout@v4
with:
path: ${{ env.our_path }}

- name: Check out ${{ matrix.repo.name }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo.name }}
path: ${{ env.test_repo_path }}

- name: Check for branch ${{ github.head_ref }}
working-directory: ${{ env.test_repo_path }}
if: github.event_name == 'pull_request'
run: |
git remote update
git checkout ${{ github.head_ref }} || echo "${{github.head_ref}} not found, checking base ${{github.base_ref}}"

- name: Check for branch ${{ github.base_ref }}
working-directory: ${{ env.test_repo_path }}
if: github.event_name == 'pull_request'
run: |
git remote update
git checkout ${{ github.base_ref }} || echo "${{github.base_ref}} not found Falling back to main"


- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.10'
cache: true
cache-dependency-path: './**/pyproject.toml'

- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v3
with:
working-directory: ${{ env.test_repo_path }}

- name: Run tests
working-directory: ${{ env.test_repo_path }}
run: |
pdm test

- name: Submit build ${{ env.is_dry }}
working-directory: ${{ env.test_repo_path }}/${{ matrix.repo.design }}
run: |
pdm run chipflow pin lock
pdm run chipflow silicon submit --wait $DRY
env:
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
21 changes: 3 additions & 18 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Clone chipflow-examples

.. note::
If you’re familiar with the `Git <https://git-scm.com/>`__ command line
then go clone [ChipFlow/chipflow-examples](https://github.com/ChipFlow/chipflow-examples)
then go clone `ChipFlow/chipflow-examples <https://github.com/ChipFlow/chipflow-examples>`,
switch to the `release branch <https://github.com/ChipFlow/chipflow-examples/tree/release>`,
and jump ahead to `Install the Dependencies`_


Expand All @@ -39,7 +40,7 @@ it you will be asked to sign in or create an account - we recommend you
take this moment to create a GitHub account if you don’t already have
one!

Navigate to `the chipflow-examples repository <https://github.com/ChipFlow/chipflow-examples>`__
Navigate to `the chipflow-examples repository release branch <https://github.com/ChipFlow/chipflow-examples/tree/release>`__
and click the green ‘Code’ button at the top. Select ‘Open with GitHub Desktop’ and
then follow the prompts (N.B. your web browser may have a pop-up to
authorise opening an external app)
Expand Down Expand Up @@ -165,19 +166,3 @@ you can instead call:
.. |Image showing the link to click| image:: _assets/open-github-desktop.png
.. |Image showing where to click in GitHub Desktop to open in VSCode| image:: _assets/github-desktop-open.png


Installation
------------

1. Clone the ChipFlow repository:

.. code-block:: bash

git clone https://github.com/ChipFlow/chipflow-lib.git
cd chipflow-lib

2. Install dependencies using PDM:

.. code-block:: bash

pdm install
Loading
Loading