Skip to content

Commit 1f6b533

Browse files
committed
Check test repo branch name
1 parent b612b3e commit 1f6b533

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

.github/workflows/main.yaml

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,29 @@ jobs:
6262
strategy:
6363
matrix:
6464
dry: [true, false]
65+
repo:
66+
- name: "chipflow-examples"
67+
design: "minimal"
68+
- name: "chipflow-test-socs"
69+
design: "sram"
6570
env:
6671
DRY: ${{ matrix.dry && '--dry-run' || '' }}
6772
IS_DRY: ${{ matrix.dry && '(dry run)' || '' }}
6873
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
6974

7075
steps:
71-
- name: Check out chipflow-examples
76+
- name: Check out ${{ matrix.repo.name }}
7277
uses: actions/checkout@v4
7378
with:
74-
repository: ChipFlow/chipflow-examples
79+
repository: ChipFlow/${{ matrix.repo.name }}
7580
fetch-depth: 0
76-
path: chipflow-examples
77-
ref: ${{ github.head_ref || 'refs/heads/main' }}
81+
path: ${{ matrix.repo.name }}
82+
83+
- name: Check for branch ${{ github.head_ref }}
84+
working-directory: ./${{ matrix.repo.name }}
85+
if: github.event_name == 'pull_request'
86+
run: |
87+
git checkout ${{ github.head_ref }} || echo "Falling back to main"
7888
7989
- name: Set up PDM
8090
uses: pdm-project/setup-pdm@v4
@@ -84,35 +94,35 @@ jobs:
8494
cache-dependency-path: './**/pyproject.toml'
8595

8696
- name: Generate overrides to use current branch if PR
87-
working-directory: ./chipflow-examples
97+
working-directory: ./${{ matrix.repo.name }}
8898
if: github.event_name == 'pull_request'
8999
run: |
90100
pdm run tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
91101
echo "Generated overrides:"
92102
cat overrides.txt
93103
94104
- name: Relock PDM
95-
working-directory: ./chipflow-examples
105+
working-directory: ./${{ matrix.repo.name }}
96106
if: github.event_name != 'pull_request'
97107
run: pdm lock -d
98108

99109
- name: Relock PDM (PR)
100-
working-directory: ./chipflow-examples
110+
working-directory: ./${{ matrix.repo.name }}
101111
if: github.event_name == 'pull_request'
102112
run: pdm lock -d --override overrides.txt
103113

104114
- name: Install dependencies
105-
working-directory: ./chipflow-examples
115+
working-directory: ./${{ matrix.repo.name }}
106116
run: |
107117
pdm install
108118
109119
- name: Run tests
110-
working-directory: ./chipflow-examples
120+
working-directory: ./${{ matrix.repo.name }}
111121
run: |
112122
pdm test
113123
114124
- name: Submit build ${{ env.is_dry }}
115-
working-directory: ./chipflow-examples/minimal
125+
working-directory: ./${{ matrix.repo.name }}/${{ matrix.repo.design }}
116126
run: |
117127
pdm run chipflow pin lock
118128
pdm run chipflow silicon submit --wait $DRY

0 commit comments

Comments
 (0)