Skip to content

Commit 2ac5bcf

Browse files
committed
ci: parallelise jobs, remove HF download, commit source_list fixture (The-OpenROAD-Project#288)
* ci: parallelise jobs, remove HF download, commit source_list fixture - Split monolithic build-backend-docker into lint-backend, lint-frontend, lint-evaluation (parallel), test (needs lint-backend only), and docker-build (needs test + frontend/evaluation lint) - Scope init-dev to each job's module to avoid redundant uv sync calls - Remove huggingface-cli download; commit backend/data/source_list.json as a static test fixture instead - Add --parallel to docker compose build - Add check-ci root Makefile target (ruff+mypy per module, no pre-commit) - Unignore backend/data/source_list.json in .gitignore Signed-off-by: Jack Luar <jluar@precisioninno.com> * ci: run lint jobs on ubuntu-latest to reduce self-hosted contention Lint jobs only need Python + uv — no Docker or local services. Moving them to ubuntu-latest frees self-hosted runners for test and docker-build. Signed-off-by: Jack Luar <jluar@precisioninno.com> --------- Signed-off-by: Jack Luar <jluar@precisioninno.com>
1 parent faa73a7 commit 2ac5bcf

4 files changed

Lines changed: 81 additions & 13 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 72 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ defaults:
1515
shell: bash
1616

1717
jobs:
18-
build-backend-docker:
19-
runs-on: self-hosted
18+
lint-backend:
19+
runs-on: ubuntu-latest
2020
steps:
2121
- name: Setup python
2222
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
@@ -29,22 +29,82 @@ jobs:
2929
- name: Checkout code
3030
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
3131

32-
- name: Setup prereqs
33-
run: |
34-
make init-dev
32+
- name: Install deps
33+
run: cd backend && make init-dev
3534

36-
- name: Run formatting checks
37-
run: |
38-
make check
35+
- name: Lint
36+
run: cd backend && make check
37+
38+
lint-frontend:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- name: Setup python
42+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
43+
with:
44+
python-version: '3.12'
45+
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
48+
49+
- name: Checkout code
50+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
51+
52+
- name: Install deps
53+
run: cd frontend && make init-dev
54+
55+
- name: Lint
56+
run: cd frontend && make check
57+
58+
lint-evaluation:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Setup python
62+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
63+
with:
64+
python-version: '3.12'
65+
66+
- name: Install uv
67+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
68+
69+
- name: Checkout code
70+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
71+
72+
- name: Install deps
73+
run: cd evaluation && make init-dev
74+
75+
- name: Lint
76+
run: cd evaluation && make check
77+
78+
test:
79+
needs: [lint-backend]
80+
runs-on: self-hosted
81+
steps:
82+
- name: Setup python
83+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
84+
with:
85+
python-version: '3.12'
86+
87+
- name: Install uv
88+
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
89+
90+
- name: Checkout code
91+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
92+
93+
- name: Install deps
94+
run: cd backend && make init-dev
3995

4096
- name: Run unit tests
4197
working-directory: backend
4298
run: |
43-
uv pip install huggingface_hub[cli]
44-
huggingface-cli download --repo-type dataset The-OpenROAD-Project/ORAssistant_RAG_Dataset --include source_list.json --local-dir data/
4599
cp .env.test .env
46100
make test
47101
102+
docker-build:
103+
needs: [test, lint-frontend, lint-evaluation]
104+
runs-on: self-hosted
105+
steps:
106+
- name: Checkout code
107+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
108+
48109
- name: Build Docker images
49-
run: |
50-
docker compose build
110+
run: docker compose build --parallel

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.env
22
*.ipynb
33
__pycache__/
4-
backend/data/
4+
backend/data/*
5+
!backend/data/source_list.json
56
backend/src/*.json
67
*.pyc
78
*.egg-info/

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ check:
2626
@. ./backend/.venv/bin/activate && \
2727
pre-commit run --all-files
2828

29+
.PHONY: check-ci
30+
check-ci:
31+
@for folder in $(FOLDERS); do \
32+
(cd $$folder && make check && cd ../) || exit 1; \
33+
done
34+
2935
.PHONY: docker-up
3036
docker-up:
3137
@docker compose -f docker-compose.yml up --build --wait

backend/data/source_list.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)