Skip to content
Draft
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
92 changes: 34 additions & 58 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
- main
pull_request:
merge_group:
schedule:
- cron: '0 0 * * *' # Every day at midnight UTC

name: CI
jobs:
Expand All @@ -13,19 +15,21 @@ jobs:
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
- name: Install dependencies

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

- name: Run tests
run: |
pdm install
pdm run test
- name: Run lints
run: |
pdm run lint
- name: Run tests
run: |
pdm run test
- name: Run doc tests
run: pdm run test-docs

license:
runs-on: ubuntu-latest
Expand All @@ -35,79 +39,51 @@ 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: docker run --platform=linux/amd64 -v ${{github.workspace}}:/src ghcr.io/google/addlicense -v -check -l BSD-2-Clause -c "ChipFlow" -s=only -ignore **/__init__.py **/*.py

test-submit:
runs-on: ubuntu-latest
strategy:
matrix:
dry: [true, false]
env:
DRY: ${{ matrix.dry && '--dry-run' || '' }}
IS_DRY: ${{ matrix.dry && '(dry run)' || '' }}
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}

steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: amaranth-orchard

- name: Check out chipflow-examples
uses: actions/checkout@v4
with:
repository: ChipFlow/chipflow-examples
fetch-depth: 0
path: chipflow-examples
ref: ${{ github.head_ref || 'refs/heads/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: Install dependencies
working-directory: ./chipflow-examples
run: |
pdm install
pdm run python -m ensurepip
pdm run python -m pip install -e ../amaranth-orchard
- name: Run tests
working-directory: ./chipflow-examples
run: |
pdm test
pdm run chipflow pin lock
pdm run chipflow silicon submit --wait
env:
CHIPFLOW_API_ORIGIN: 'https://build-staging.chipflow.org'
CHIPFLOW_API_KEY_ID: ${{ secrets.CHIPFLOW_API_KEY_ID }}
CHIPFLOW_API_KEY_SECRET: ${{ secrets.CHIPFLOW_API_KEY_SECRET }}
CHIPFLOW_BACKEND_VERSION: b7afdbf
cache-dependency-path: './**/pyproject.toml'

test-submit-dry:
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
fetch-depth: 0
path: amaranth-orchard
- 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
- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v1
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 ../amaranth-orchard
working-directory: './chipflow-examples'

- name: Run tests
working-directory: ./chipflow-examples
run: |
pdm test

- name: Submit build ${{ env.is_dry }}
working-directory: ./chipflow-examples/minimal
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}}
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ dependencies = [
"chipflow-lib @ git+https://github.com/ChipFlow/chipflow-lib.git",
"amaranth-soc @ git+https://github.com/amaranth-lang/amaranth-soc",
"amaranth-stdio @ git+https://github.com/amaranth-lang/amaranth-stdio",
"pytest>=7.2.0",
]

# Build system configuration
Expand Down Expand Up @@ -45,9 +44,10 @@ test.cmd = "pytest"
test-cov.cmd = "pytest --cov=amaranth-orchard cov-report=term"
test-cov-html.cmd = "pytest --cov=amaranth-orchard --cov-report=html"
# test-docs.cmd = "sphinx-build -b doctest docs/ docs/_build"
test-docs.cmd = "true"
lint.cmd = "ruff check"
# docs.cmd = "sphinx-build docs/ docs/_build/ -W --keep-going"
test-examples.working_dir = "."
#docs.cmd = "sphinx-build docs/ docs/_build/ -W --keep-going"
doc.cmd = "true"


[dependency-groups]
Expand Down
4 changes: 4 additions & 0 deletions tools/license_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: BSD-2-Clause
#!/bin/bash


Loading