Skip to content

Commit 52096f8

Browse files
committed
Use overrides for using the same branchname over multiple repos
1 parent 4128a75 commit 52096f8

File tree

7 files changed

+155
-165
lines changed

7 files changed

+155
-165
lines changed

.github/workflows/coverage.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
name: pytest-coverage-comment
44
on:
55
pull_request:
6-
branches:
7-
- '*'
86

97
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
108
# `contents` is for permission to the contents of the repository.
@@ -18,16 +16,15 @@ jobs:
1816
build:
1917
runs-on: ubuntu-latest
2018
steps:
21-
- uses: actions/checkout@v3
22-
with:
23-
fetch-depth: 0
19+
- uses: actions/checkout@v4
2420

2521
- name: Set up PDM
2622
uses: pdm-project/setup-pdm@v4
23+
with:
24+
cache: true
2725

28-
- name: Install dependencies
29-
run: |
30-
pdm install
26+
- name: Install dependencies with multirepo
27+
uses: chipflow/pdm-multirepo@v1
3128

3229
- name: Build coverage file
3330
run: |

.github/workflows/deploy-docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
- name: Setup PDM
1414
uses: pdm-project/setup-pdm@v4
1515
with:
16-
python-version: 3.12
1716
cache: true
1817

1918
- name: Install dependencies

.github/workflows/main.yaml

Lines changed: 46 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ jobs:
1919
fetch-depth: 0
2020
- name: Set up PDM
2121
uses: pdm-project/setup-pdm@v4
22-
- name: Install dependencies
23-
run: |
24-
pdm install
22+
with:
23+
cache: true
24+
25+
- name: Install dependencies with multirepo
26+
uses: chipflow/pdm-multirepo@v1
27+
2528
- name: Run tests
2629
run: |
2730
pdm run test
@@ -39,75 +42,64 @@ jobs:
3942
with:
4043
fetch-depth: 0
4144
- name: Check source code licenses
42-
run: |
43-
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
45+
run: ./tools/license_check.sh
4446

4547
test-submit:
4648
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
dry: [true, false]
52+
repo:
53+
- name: "ChipFlow/chipflow-examples"
54+
design: "minimal"
55+
env:
56+
DRY: ${{ matrix.dry && '--dry-run' || '' }}
57+
is_dry: ${{ matrix.dry && '(dry run)' || '' }}
58+
our_path: "${{ github.workspace}}/${{ github.repo }}"
59+
test_repo_path: "${{ github.workspace }}/${{ matrix.repo.name }}"
60+
61+
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
62+
4763
steps:
4864
- name: Check out source code
4965
uses: actions/checkout@v4
5066
with:
51-
fetch-depth: 0
52-
path: chipflow-lib
53-
- name: Check out chipflow-examples
67+
path: ${{ env.our_path }}
68+
69+
- name: Check out ${{ matrix.repo.name }}
5470
uses: actions/checkout@v4
5571
with:
56-
repository: ChipFlow/chipflow-examples
57-
fetch-depth: 0
58-
path: chipflow-examples
72+
repository: ${{ matrix.repo.name }}
73+
path: ${{ env.test_repo_path }}
74+
75+
- name: Check for branch ${{ github.head_ref }}
76+
working-directory: ${{ env.test_repo_path }}
77+
if: github.event_name == 'pull_request'
78+
run: |
79+
git remote update
80+
git checkout ${{ github.head_ref }} || echo "Falling back to main"
5981
6082
- name: Set up PDM
6183
uses: pdm-project/setup-pdm@v4
6284
with:
63-
python-version: "3.10"
85+
python-version: '3.10'
6486
cache: true
65-
cache-dependency-path: "./**/pyproject.toml"
66-
- name: Install dependencies
67-
working-directory: ./chipflow-examples
68-
run: |
69-
pdm install
70-
pdm run python -m ensurepip
71-
pdm run python -m pip install -e ../chipflow-lib
72-
- name: Run tests
73-
working-directory: ./chipflow-examples/minimal
74-
run: |
75-
pdm test
76-
pdm run chipflow pin lock
77-
pdm run chipflow silicon submit --wait
78-
env:
79-
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
87+
cache-dependency-path: './**/pyproject.toml'
8088

81-
test-submit-dry:
82-
runs-on: ubuntu-latest
83-
steps:
84-
- name: Check out source code
85-
uses: actions/checkout@v4
86-
with:
87-
fetch-depth: 0
88-
path: chipflow-lib
89-
- name: Check out chipflow-examples
90-
uses: actions/checkout@v4
89+
- name: Install dependencies with multirepo
90+
uses: chipflow/pdm-multirepo@v1
9191
with:
92-
repository: ChipFlow/chipflow-examples
93-
fetch-depth: 0
94-
path: chipflow-examples
92+
working-directory: ${{ env.test_repo_path }}
9593

96-
- name: Set up PDM
97-
uses: pdm-project/setup-pdm@v4
98-
with:
99-
python-version: "3.10"
100-
cache: true
101-
cache-dependency-path: "./**/pyproject.toml"
102-
- name: Install dependencies
103-
working-directory: ./chipflow-examples
104-
run: |
105-
pdm install
106-
pdm run python -m ensurepip
107-
pdm run python -m pip install -e ../chipflow-lib
10894
- name: Run tests
109-
working-directory: ./chipflow-examples/minimal
95+
working-directory: ${{ env.test_repo_path }}
11096
run: |
11197
pdm test
98+
99+
- name: Submit build ${{ env.is_dry }}
100+
working-directory: ${{ env.test_repo_path }}/${{ matrix.repo.design }}
101+
run: |
112102
pdm run chipflow pin lock
113-
pdm run chipflow silicon submit --dry-run
103+
pdm run chipflow silicon submit --wait $DRY
104+
env:
105+
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}

.github/workflows/preview-docs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ jobs:
1717
- name: Setup PDM
1818
uses: pdm-project/setup-pdm@v4
1919
with:
20-
python-version: 3.12
2120
cache: true
2221

23-
- name: Install dependencies
24-
run: pdm install
22+
- name: Install dependencies with multirepo
23+
uses: chipflow/pdm-multirepo@v1
2524

2625
- name: Build docs
2726
run: pdm docs

0 commit comments

Comments
 (0)