Skip to content

Commit 8079ea9

Browse files
committed
use tools from chipflow-lib
1 parent 246b442 commit 8079ea9

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

.github/workflows/main.yaml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ jobs:
1515
steps:
1616
- name: Check out source code
1717
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
18+
2019
- name: Set up PDM
2120
uses: pdm-project/setup-pdm@v4
2221

@@ -63,27 +62,33 @@ jobs:
6362
matrix:
6463
dry: [true, false]
6564
repo:
66-
- name: "chipflow-examples"
65+
- name: "ChipFlow/chipflow-examples"
6766
design: "minimal"
68-
- name: "chipflow-test-socs"
69-
design: "sram"
7067
env:
7168
DRY: ${{ matrix.dry && '--dry-run' || '' }}
72-
IS_DRY: ${{ matrix.dry && '(dry run)' || '' }}
69+
is_dry: ${{ matrix.dry && '(dry run)' || '' }}
70+
our_path: "${{ github.workspace}}/${{ github.repo }}"
71+
test_repo_path: "${{ github.workspace }}/${{ matrix.repo.name }}"
72+
7373
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
7474

7575
steps:
76+
- name: Check out source code
77+
uses: actions/checkout@v4
78+
with:
79+
path: ${{ env.our_path }}
80+
7681
- name: Check out ${{ matrix.repo.name }}
7782
uses: actions/checkout@v4
7883
with:
79-
repository: ChipFlow/${{ matrix.repo.name }}
80-
fetch-depth: 0
81-
path: ${{ matrix.repo.name }}
84+
repository: ${{ matrix.repo.name }}
85+
path: ${{ env.test_repo_path }}
8286

8387
- name: Check for branch ${{ github.head_ref }}
84-
working-directory: ./${{ matrix.repo.name }}
88+
working-directory: ${{ env.test_repo_path }}
8589
if: github.event_name == 'pull_request'
8690
run: |
91+
git remote update
8792
git checkout ${{ github.head_ref }} || echo "Falling back to main"
8893
8994
- name: Set up PDM
@@ -94,35 +99,35 @@ jobs:
9499
cache-dependency-path: './**/pyproject.toml'
95100

96101
- name: Generate overrides to use current branch if PR
97-
working-directory: ./${{ matrix.repo.name }}
102+
working-directory: ${{ env.test_repo_path }}
98103
if: github.event_name == 'pull_request'
99104
run: |
100-
pdm run tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
105+
pdm run ${{env.our_path}}/tools/gen_overrides.py ${{github.head_ref}} > overrides.txt
101106
echo "Generated overrides:"
102107
cat overrides.txt
103108
104109
- name: Relock PDM
105-
working-directory: ./${{ matrix.repo.name }}
110+
working-directory: ${{ env.test_repo_path }}
106111
if: github.event_name != 'pull_request'
107112
run: pdm lock -d
108113

109114
- name: Relock PDM (PR)
110-
working-directory: ./${{ matrix.repo.name }}
115+
working-directory: ${{ env.test_repo_path }}
111116
if: github.event_name == 'pull_request'
112117
run: pdm lock -d --override overrides.txt
113118

114119
- name: Install dependencies
115-
working-directory: ./${{ matrix.repo.name }}
120+
working-directory: ${{ env.test_repo_path }}
116121
run: |
117122
pdm install
118123
119124
- name: Run tests
120-
working-directory: ./${{ matrix.repo.name }}
125+
working-directory: ${{ env.test_repo_path }}
121126
run: |
122127
pdm test
123128
124129
- name: Submit build ${{ env.is_dry }}
125-
working-directory: ./${{ matrix.repo.name }}/${{ matrix.repo.design }}
130+
working-directory: ${{ env.test_repo_path }}/${{ matrix.repo.design }}
126131
run: |
127132
pdm run chipflow pin lock
128133
pdm run chipflow silicon submit --wait $DRY

0 commit comments

Comments
 (0)