@@ -18,12 +18,11 @@ jobs:
1818
1919 - name : Set up PDM
2020 uses : pdm-project/setup-pdm@v4
21+ with :
22+ cache : true
2123
22- - name : Re-lock PDM dependencies
23- run : pdm lock -d
24-
25- - name : Install dependencies
26- run : pdm install
24+ - name : Install dependencies with multirepo
25+ uses : chipflow/pdm-multirepo@v1
2726
2827 - name : Run tests
2928 run : pdm run test
@@ -42,89 +41,64 @@ jobs:
4241 with :
4342 fetch-depth : 0
4443 - name : Check source code licenses
45- run : |
46- 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
44+ run : ./tools/license_check.sh
4745
4846 test-submit :
4947 runs-on : ubuntu-latest
48+ strategy :
49+ matrix :
50+ dry : [true, false]
51+ repo :
52+ - name : " ChipFlow/chipflow-examples"
53+ design : " minimal"
54+ env :
55+ DRY : ${{ matrix.dry && '--dry-run' || '' }}
56+ is_dry : ${{ matrix.dry && '(dry run)' || '' }}
57+ our_path : " ${{ github.workspace}}/${{ github.repo }}"
58+ test_repo_path : " ${{ github.workspace }}/${{ matrix.repo.name }}"
59+
60+ name : ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
61+
5062 steps :
5163 - name : Check out source code
5264 uses : actions/checkout@v4
5365 with :
54- fetch-depth : 0
55- path : chipflow-lib
66+ path : ${{ env.our_path }}
5667
57- - name : Check out chipflow-examples
68+ - name : Check out ${{ matrix.repo.name }}
5869 uses : actions/checkout@v4
5970 with :
60- repository : ChipFlow/chipflow-examples
61- fetch-depth : 0
62- path : chipflow-examples
63-
64- - name : Set up PDM
65- uses : pdm-project/setup-pdm@v4
66- with :
67- python-version : " 3.10"
68- cache : true
69- cache-dependency-path : " ./**/pyproject.toml"
71+ repository : ${{ matrix.repo.name }}
72+ path : ${{ env.test_repo_path }}
7073
71- - name : Re-lock PDM dependencies
72- working-directory : ./chipflow-examples
73- run : pdm lock -d
74-
75- - name : Install dependencies
76- working-directory : ./chipflow-examples
74+ - name : Check for branch ${{ github.head_ref }}
75+ working-directory : ${{ env.test_repo_path }}
76+ if : github.event_name == 'pull_request'
7777 run : |
78- pdm install
79- pdm run python -m ensurepip
80- pdm run python -m pip install -e ../chipflow-lib
81-
82- - name : Run tests
83- working-directory : ./chipflow-examples/minimal
84- run : |
85- pdm test
86- pdm run chipflow pin lock
87- pdm run chipflow silicon submit --wait
88- env :
89- CHIPFLOW_API_KEY : ${{ secrets.CHIPFLOW_API_KEY}}
90-
91- test-submit-dry :
92- runs-on : ubuntu-latest
93- steps :
94- - name : Check out source code
95- uses : actions/checkout@v4
96- with :
97- fetch-depth : 0
98- path : chipflow-lib
99-
100- - name : Check out chipflow-examples
101- uses : actions/checkout@v4
102- with :
103- repository : ChipFlow/chipflow-examples
104- fetch-depth : 0
105- path : chipflow-examples
78+ git remote update
79+ git checkout ${{ github.head_ref }} || echo "Falling back to main"
10680
10781 - name : Set up PDM
10882 uses : pdm-project/setup-pdm@v4
10983 with :
110- python-version : " 3.10"
84+ python-version : ' 3.10'
11185 cache : true
112- cache-dependency-path : " ./**/pyproject.toml"
113-
114- - name : Re-lock PDM dependencies
115- working-directory : ./chipflow-examples
116- run : pdm lock -d
86+ cache-dependency-path : ' ./**/pyproject.toml'
11787
118- - name : Install dependencies
119- working-directory : ./chipflow-examples
120- run : |
121- pdm install
122- pdm run python -m ensurepip
123- pdm run python -m pip install -e ../chipflow-lib
88+ - name : Install dependencies with multirepo
89+ uses : chipflow/pdm-multirepo@v1
90+ with :
91+ working-directory : ${{ env.test_repo_path }}
12492
12593 - name : Run tests
126- working-directory : ./chipflow-examples/minimal
94+ working-directory : ${{ env.test_repo_path }}
12795 run : |
12896 pdm test
97+
98+ - name : Submit build ${{ env.is_dry }}
99+ working-directory : ${{ env.test_repo_path }}/${{ matrix.repo.design }}
100+ run : |
129101 pdm run chipflow pin lock
130- pdm run chipflow silicon submit --dry-run
102+ pdm run chipflow silicon submit --wait $DRY
103+ env :
104+ CHIPFLOW_API_KEY : ${{ secrets.CHIPFLOW_API_KEY}}
0 commit comments