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@v1

- 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
110 changes: 42 additions & 68 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ jobs:

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

- name: Re-lock PDM dependencies
run: pdm lock -d

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

- name: Run tests
run: pdm run test
Expand All @@ -42,89 +41,64 @@ 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
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:
fetch-depth: 0
path: chipflow-lib
path: ${{ env.our_path }}

- name: Check out chipflow-examples
- name: Check out ${{ matrix.repo.name }}
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"
repository: ${{ matrix.repo.name }}
path: ${{ env.test_repo_path }}

- name: Re-lock PDM dependencies
working-directory: ./chipflow-examples
run: pdm lock -d

- name: Install dependencies
working-directory: ./chipflow-examples
- name: Check for branch ${{ github.head_ref }}
working-directory: ${{ env.test_repo_path }}
if: github.event_name == 'pull_request'
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
git remote update
git checkout ${{ github.head_ref }} || echo "Falling back to main"

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

- name: Re-lock PDM dependencies
working-directory: ./chipflow-examples
run: pdm lock -d
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: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v1
with:
working-directory: ${{ env.test_repo_path }}

- name: Run tests
working-directory: ./chipflow-examples/minimal
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 --dry-run
pdm run chipflow silicon submit --wait $DRY
env:
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@v1

- name: Build docs
run: pdm docs
Expand Down
Loading
Loading