1919 fetch-depth : 0
2020 - name : Set up PDM
2121 uses : pdm-project/setup-pdm@v4
22- - name : Install dependencies
23- run : |
24- pdm install
22+ with :
23+ cache : true
24+
25+ - name : Install dependencies with multirepo
26+ uses : chipflow/pdm-multirepo@v1
27+
2528 - name : Run tests
2629 run : |
2730 pdm run test
@@ -39,75 +42,64 @@ jobs:
3942 with :
4043 fetch-depth : 0
4144 - name : Check source code licenses
42- run : |
43- 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
45+ run : ./tools/license_check.sh
4446
4547 test-submit :
4648 runs-on : ubuntu-latest
49+ strategy :
50+ matrix :
51+ dry : [true, false]
52+ repo :
53+ - name : " ChipFlow/chipflow-examples"
54+ design : " minimal"
55+ env :
56+ DRY : ${{ matrix.dry && '--dry-run' || '' }}
57+ is_dry : ${{ matrix.dry && '(dry run)' || '' }}
58+ our_path : " ${{ github.workspace}}/${{ github.repo }}"
59+ test_repo_path : " ${{ github.workspace }}/${{ matrix.repo.name }}"
60+
61+ name : ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
62+
4763 steps :
4864 - name : Check out source code
4965 uses : actions/checkout@v4
5066 with :
51- fetch-depth : 0
52- path : chipflow-lib
53- - name : Check out chipflow-examples
67+ path : ${{ env.our_path }}
68+
69+ - name : Check out ${{ matrix.repo.name }}
5470 uses : actions/checkout@v4
5571 with :
56- repository : ChipFlow/chipflow-examples
57- fetch-depth : 0
58- path : chipflow-examples
72+ repository : ${{ matrix.repo.name }}
73+ path : ${{ env.test_repo_path }}
74+
75+ - name : Check for branch ${{ github.head_ref }}
76+ working-directory : ${{ env.test_repo_path }}
77+ if : github.event_name == 'pull_request'
78+ run : |
79+ git remote update
80+ git checkout ${{ github.head_ref }} || echo "Falling back to main"
5981
6082 - name : Set up PDM
6183 uses : pdm-project/setup-pdm@v4
6284 with :
63- python-version : " 3.10"
85+ python-version : ' 3.10'
6486 cache : true
65- cache-dependency-path : " ./**/pyproject.toml"
66- - name : Install dependencies
67- working-directory : ./chipflow-examples
68- run : |
69- pdm install
70- pdm run python -m ensurepip
71- pdm run python -m pip install -e ../chipflow-lib
72- - name : Run tests
73- working-directory : ./chipflow-examples/minimal
74- run : |
75- pdm test
76- pdm run chipflow pin lock
77- pdm run chipflow silicon submit --wait
78- env :
79- CHIPFLOW_API_KEY : ${{ secrets.CHIPFLOW_API_KEY}}
87+ cache-dependency-path : ' ./**/pyproject.toml'
8088
81- test-submit-dry :
82- runs-on : ubuntu-latest
83- steps :
84- - name : Check out source code
85- uses : actions/checkout@v4
86- with :
87- fetch-depth : 0
88- path : chipflow-lib
89- - name : Check out chipflow-examples
90- uses : actions/checkout@v4
89+ - name : Install dependencies with multirepo
90+ uses : chipflow/pdm-multirepo@v1
9191 with :
92- repository : ChipFlow/chipflow-examples
93- fetch-depth : 0
94- path : chipflow-examples
92+ working-directory : ${{ env.test_repo_path }}
9593
96- - name : Set up PDM
97- uses : pdm-project/setup-pdm@v4
98- with :
99- python-version : " 3.10"
100- cache : true
101- cache-dependency-path : " ./**/pyproject.toml"
102- - name : Install dependencies
103- working-directory : ./chipflow-examples
104- run : |
105- pdm install
106- pdm run python -m ensurepip
107- pdm run python -m pip install -e ../chipflow-lib
10894 - name : Run tests
109- working-directory : ./chipflow-examples/minimal
95+ working-directory : ${{ env.test_repo_path }}
11096 run : |
11197 pdm test
98+
99+ - name : Submit build ${{ env.is_dry }}
100+ working-directory : ${{ env.test_repo_path }}/${{ matrix.repo.design }}
101+ run : |
112102 pdm run chipflow pin lock
113- pdm run chipflow silicon submit --dry-run
103+ pdm run chipflow silicon submit --wait $DRY
104+ env :
105+ CHIPFLOW_API_KEY : ${{ secrets.CHIPFLOW_API_KEY}}
0 commit comments