Skip to content

Commit 25d2250

Browse files
committed
wip
1 parent 988239f commit 25d2250

File tree

2 files changed

+39
-36
lines changed

2 files changed

+39
-36
lines changed

.github/workflows/main.yaml

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -55,75 +55,74 @@ jobs:
5555
with:
5656
fetch-depth: 0
5757
- name: Check source code licenses
58-
run: |
59-
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
58+
run: ./tools/license_check.sh
6059

6160
test-submit:
6261
runs-on: ubuntu-latest
62+
strategy:
63+
matrix:
64+
dry: [true, false]
65+
env:
66+
DRY: ${{ matrix.dry && '--dry-run' || '' }}
67+
IS_DRY: ${{ matrix.dry && '(dry run)' || '' }}
68+
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
69+
6370
steps:
6471
- name: Check out source code
6572
uses: actions/checkout@v4
6673
with:
6774
fetch-depth: 0
6875
path: chipflow-lib
76+
6977
- name: Check out chipflow-examples
7078
uses: actions/checkout@v4
7179
with:
7280
repository: ChipFlow/chipflow-examples
7381
fetch-depth: 0
7482
path: chipflow-examples
83+
ref: ${{ github.head_ref || 'refs/heads/main' }}
7584

7685
- name: Set up PDM
7786
uses: pdm-project/setup-pdm@v4
7887
with:
79-
python-version: "3.10"
88+
python-version: '3.10'
8089
cache: true
81-
cache-dependency-path: "./**/pyproject.toml"
82-
- name: Install dependencies
90+
cache-dependency-path: './**/pyproject.toml'
91+
92+
- name: Generate overrides to use current branch if PR
8393
working-directory: ./chipflow-examples
94+
if: github.event_name == 'pull_request'
8495
run: |
85-
pdm install
86-
pdm run python -m ensurepip
87-
pdm run python -m pip install -e ../chipflow-lib
88-
- name: Run tests
96+
pdm run tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
97+
echo "Generated overrides:"
98+
cat overrides.txt
99+
100+
- name: Relock PDM
89101
working-directory: ./chipflow-examples
90-
run: |
91-
pdm test
92-
pdm run chipflow pin lock
93-
pdm run chipflow silicon submit --wait
94-
env:
95-
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
102+
if: github.event_name != 'pull_request'
103+
run: pdm lock -d
96104

97-
test-submit-dry:
98-
runs-on: ubuntu-latest
99-
steps:
100-
- name: Check out source code
101-
uses: actions/checkout@v4
102-
with:
103-
fetch-depth: 0
104-
path: chipflow-lib
105-
- name: Check out chipflow-examples
106-
uses: actions/checkout@v4
107-
with:
108-
repository: ChipFlow/chipflow-examples
109-
fetch-depth: 0
110-
path: chipflow-examples
105+
- name: Relock PDM (PR)
106+
working-directory: ./chipflow-examples
107+
if: github.event_name == 'pull_request'
108+
run: pdm lock -d --override overrides.txt
111109

112-
- name: Set up PDM
113-
uses: pdm-project/setup-pdm@v4
114-
with:
115-
python-version: "3.10"
116-
cache: true
117-
cache-dependency-path: "./**/pyproject.toml"
118110
- name: Install dependencies
119111
working-directory: ./chipflow-examples
120112
run: |
121113
pdm install
122114
pdm run python -m ensurepip
123115
pdm run python -m pip install -e ../chipflow-lib
116+
124117
- name: Run tests
125118
working-directory: ./chipflow-examples
126119
run: |
127120
pdm test
121+
122+
- name: Submit build ${{ env.is_dry }}
123+
working-directory: ./chipflow-examples/minimal
124+
run: |
128125
pdm run chipflow pin lock
129-
pdm run chipflow silicon submit --dry-run
126+
pdm run chipflow silicon submit --wait $DRY
127+
env:
128+
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}

tools/license_check.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
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
3+
4+

0 commit comments

Comments
 (0)