@@ -60,12 +60,16 @@ jobs:
6060
6161 test-submit :
6262 runs-on : ubuntu-latest
63+ strategy :
64+ matrix :
65+ dry : [true, false]
6366 steps :
6467 - name : Check out source code
6568 uses : actions/checkout@v4
6669 with :
6770 fetch-depth : 0
68- path : chipflow-lib
71+ path : amaranth-orchard
72+
6973 - name : Check out chipflow-examples
7074 uses : actions/checkout@v4
7175 with :
@@ -79,51 +83,36 @@ jobs:
7983 python-version : " 3.10"
8084 cache : true
8185 cache-dependency-path : " ./**/pyproject.toml"
82- - name : Install dependencies
86+
87+ - name : Generate overrides to use current branch if PR
8388 working-directory : ./chipflow-examples
89+ if : github.event_name == 'pull_request'
8490 run : |
85- pdm install
86- pdm run python -m ensurepip
87- pdm run python -m pip install -e ../chipflow-lib
88- - name : Run tests
91+ pdm run tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
92+ echo "Generated overrides:"
93+ cat overrides.txt
94+
95+ - name : Relock PDM
8996 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}}
97+ if : github.event_name != 'pull_request'
98+ run : pdm lock -d
9699
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
100+ - name : Relock PDM (PR)
101+ working-directory : ./chipflow-examples
102+ if : github.event_name == 'pull_request'
103+ run : pdm lock -d --override overrides.txt
111104
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"
118105 - name : Install dependencies
119106 working-directory : ./chipflow-examples
120107 run : |
121108 pdm install
122109 pdm run python -m ensurepip
123- pdm run python -m pip install -e ../chipflow-lib
110+ pdm run python -m pip install -e ../amaranth-orchard
124111 - name : Run tests
125112 working-directory : ./chipflow-examples
126113 run : |
127114 pdm test
128115 pdm run chipflow pin lock
129- pdm run chipflow silicon submit --dry-run
116+ pdm run chipflow silicon submit --wait ${{ if matrix.dry && "--dry-run" }}
117+ env :
118+ CHIPFLOW_API_KEY : ${{ secrets.CHIPFLOW_API_KEY}}
0 commit comments