Skip to content

Commit dbde4a7

Browse files
committed
Check test repo branch name
1 parent 8b06d6a commit dbde4a7

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/main.yaml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ jobs:
6161
strategy:
6262
matrix:
6363
dry: [true, false]
64+
repo:
65+
- name: "chipflow-examples"
66+
design: "minimal"
67+
- name: "chipflow-test-socs"
68+
design: "sram"
6469
env:
6570
DRY: ${{ matrix.dry && '--dry-run' || '' }}
6671
IS_DRY: ${{ matrix.dry && '(dry run)' || '' }}
@@ -73,51 +78,56 @@ jobs:
7378
fetch-depth: 0
7479
path: chipflow-lib
7580

76-
- name: Check out chipflow-examples
81+
- name: Check out ${{ matrix.repo.name }}
7782
uses: actions/checkout@v4
7883
with:
79-
repository: ChipFlow/chipflow-examples
84+
repository: ChipFlow/${{ matrix.repo.name }}
8085
fetch-depth: 0
81-
path: chipflow-examples
82-
ref: ${{ github.head_ref || 'refs/heads/main' }}
86+
path: ${{ matrix.repo.name }}
87+
88+
- name: Check for branch ${{ github.head_ref }}
89+
working-directory: ./${{ matrix.repo.name }}
90+
if: github.event_name == 'pull_request'
91+
run: |
92+
git checkout ${{ github.head_ref }} || echo 'Falling back to main'
8393
8494
- name: Set up PDM
8595
uses: pdm-project/setup-pdm@v4
8696
with:
8797
python-version: '3.10'
8898
cache: true
89-
cache-dependency-path: "./**/pyproject.toml"
99+
cache-dependency-path: './**/pyproject.toml'
90100

91101
- name: Generate overrides to use current branch if PR
92-
working-directory: ./chipflow-examples
102+
working-directory: ./${{ matrix.repo.name }}
93103
if: github.event_name == 'pull_request'
94104
run: |
95105
pdm run tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
96106
echo "Generated overrides:"
97107
cat overrides.txt
98108
99109
- name: Relock PDM
100-
working-directory: ./chipflow-examples
110+
working-directory: ./${{ matrix.repo.name }}
101111
if: github.event_name != 'pull_request'
102112
run: pdm lock -d
103113

104114
- name: Relock PDM (PR)
105-
working-directory: ./chipflow-examples
115+
working-directory: ./${{ matrix.repo.name }}
106116
if: github.event_name == 'pull_request'
107117
run: pdm lock -d --override overrides.txt
108118

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

0 commit comments

Comments
 (0)