@@ -55,17 +55,24 @@ 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+
6369 steps :
6470 - name : Check out source code
6571 uses : actions/checkout@v4
6672 with :
6773 fetch-depth : 0
68- path : chipflow-lib
74+ path : amaranth-orchard
75+
6976 - name : Check out chipflow-examples
7077 uses : actions/checkout@v4
7178 with :
@@ -76,54 +83,42 @@ jobs:
7683 - name : Set up PDM
7784 uses : pdm-project/setup-pdm@v4
7885 with :
79- python-version : " 3.10"
86+ python-version : ' 3.10'
8087 cache : true
81- cache-dependency-path : " ./**/pyproject.toml"
82- - name : Install dependencies
88+ cache-dependency-path : ' ./**/pyproject.toml'
89+
90+ - name : Generate overrides to use current branch if PR
8391 working-directory : ./chipflow-examples
92+ if : github.event_name == 'pull_request'
8493 run : |
85- pdm install
86- pdm run python -m ensurepip
87- pdm run python -m pip install -e ../chipflow-lib
88- - name : Run tests
94+ pdm run tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
95+ echo "Generated overrides:"
96+ cat overrides.txt
97+
98+ - name : Relock PDM
8999 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}}
100+ if : github.event_name != 'pull_request'
101+ run : pdm lock -d
96102
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
103+ - name : Relock PDM (PR)
104+ working-directory : ./chipflow-examples
105+ if : github.event_name == 'pull_request'
106+ run : pdm lock -d --override overrides.txt
111107
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"
118108 - name : Install dependencies
119109 working-directory : ./chipflow-examples
120110 run : |
121111 pdm install
122112 pdm run python -m ensurepip
123- pdm run python -m pip install -e ../chipflow-lib
113+ pdm run python -m pip install -e ../amaranth-orchard
114+
124115 - name : Run tests
125116 working-directory : ./chipflow-examples
126117 run : |
127118 pdm test
119+
120+ - name : Submit build ${{ env.is_dry }}
128121 pdm run chipflow pin lock
129- pdm run chipflow silicon submit --dry-run
122+ pdm run chipflow silicon submit --wait $DRY
123+ env :
124+ CHIPFLOW_API_KEY : ${{ secrets.CHIPFLOW_API_KEY}}
0 commit comments