Skip to content

Commit 471baba

Browse files
🔧(tooling) run ingestion, ocr and web workflows everytime (#658)
1 parent 1023317 commit 471baba

3 files changed

Lines changed: 72 additions & 27 deletions

File tree

.github/workflows/ingestion.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,39 @@ on:
66
pull_request:
77
branches: ["main"]
88
types: [opened, synchronize, reopened, edited]
9-
paths:
10-
- "src/ingestion/**"
11-
- ".github/workflows/ingestion.yml"
12-
- ".github/actions/**"
139

1410
permissions:
1511
contents: read
1612

1713
jobs:
14+
check-changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
relevant: ${{ steps.filter.outputs.relevant }}
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d
21+
id: filter
22+
with:
23+
filters: |
24+
relevant:
25+
- "src/ingestion/**"
26+
- ".github/workflows/ingestion.yml"
27+
- ".github/actions/**"
28+
1829
build-ingestion:
30+
needs: check-changes
31+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
1932
runs-on: ubuntu-latest
2033
steps:
21-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@v6
2235
- uses: ./.github/actions/setup-uv-python
2336
with:
2437
service-path: src/ingestion
2538

2639
lint-ingestion:
27-
needs: build-ingestion
40+
needs: [check-changes, build-ingestion]
41+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
2842
runs-on: ubuntu-latest
2943
services:
3044
postgresql:
@@ -46,7 +60,7 @@ jobs:
4660
env:
4761
DATABASE_URL: postgresql+psycopg2://postgres:pass@localhost:5432/ingestion
4862
steps:
49-
- uses: actions/checkout@v5
63+
- uses: actions/checkout@v6
5064
- uses: ./.github/actions/setup-uv-python
5165
with:
5266
service-path: src/ingestion
@@ -62,7 +76,8 @@ jobs:
6276
uv run alembic check
6377
6478
test-ingestion:
65-
needs: build-ingestion
79+
needs: [check-changes, build-ingestion]
80+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
6681
runs-on: ubuntu-latest
6782
services:
6883
postgresql:
@@ -84,7 +99,7 @@ jobs:
8499
env:
85100
DATABASE_URL: postgresql+psycopg2://postgres:pass@localhost:5432/ingestion
86101
steps:
87-
- uses: actions/checkout@v5
102+
- uses: actions/checkout@v6
88103
- uses: ./.github/actions/setup-uv-python
89104
with:
90105
service-path: src/ingestion

.github/workflows/ocr.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,32 @@ on:
66
pull_request:
77
branches: ["main"]
88
types: [opened, synchronize, reopened, edited]
9-
paths:
10-
- "src/ocr/**"
11-
- ".github/workflows/ocr.yml"
12-
- ".github/actions/**"
139

1410
permissions:
1511
contents: read
1612

1713
jobs:
14+
check-changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
relevant: ${{ steps.filter.outputs.relevant }}
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d
21+
id: filter
22+
with:
23+
filters: |
24+
relevant:
25+
- "src/ocr/**"
26+
- ".github/workflows/ocr.yml"
27+
- ".github/actions/**"
28+
1829
build-ocr:
30+
needs: check-changes
31+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
1932
runs-on: ubuntu-latest
2033
steps:
21-
- uses: actions/checkout@v5
34+
- uses: actions/checkout@v6
2235
- uses: ./.github/actions/setup-uv-python
2336
with:
2437
service-path: src/ocr
@@ -28,13 +41,14 @@ jobs:
2841
sudo apt-get install -y poppler-utils tesseract-ocr tesseract-ocr-fra
2942
3043
lint-ocr:
31-
needs: build-ocr
44+
needs: [check-changes, build-ocr]
45+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
3246
runs-on: ubuntu-latest
3347
defaults:
3448
run:
3549
working-directory: ./src/ocr
3650
steps:
37-
- uses: actions/checkout@v5
51+
- uses: actions/checkout@v6
3852
- uses: ./.github/actions/setup-uv-python
3953
with:
4054
service-path: src/ocr
@@ -46,15 +60,16 @@ jobs:
4660
run: uv run mypy .
4761

4862
test-ocr:
49-
needs: build-ocr
63+
needs: [check-changes, build-ocr]
64+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
5065
runs-on: ubuntu-latest
5166
defaults:
5267
run:
5368
working-directory: ./src/ocr
5469
env:
5570
API_KEY: test-api-key-for-development
5671
steps:
57-
- uses: actions/checkout@v5
72+
- uses: actions/checkout@v6
5873
- uses: ./.github/actions/setup-uv-python
5974
with:
6075
service-path: src/ocr

.github/workflows/web.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,35 @@ on:
66
pull_request:
77
branches: ["main"]
88
types: [opened, synchronize, reopened, edited]
9-
paths:
10-
- "src/web/**"
11-
- ".github/workflows/web.yml"
12-
- ".github/actions/**"
139

1410
permissions:
1511
contents: read
1612

1713
jobs:
14+
check-changes:
15+
runs-on: ubuntu-latest
16+
outputs:
17+
relevant: ${{ steps.filter.outputs.relevant }}
18+
steps:
19+
- uses: actions/checkout@v6
20+
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d
21+
id: filter
22+
with:
23+
filters: |
24+
relevant:
25+
- "src/web/**"
26+
- ".github/workflows/web.yml"
27+
- ".github/actions/**"
28+
1829
build-web:
30+
needs: check-changes
31+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
1932
runs-on: ubuntu-latest
2033
defaults:
2134
run:
2235
working-directory: ./src/web
2336
steps:
24-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
2538
- uses: ./.github/actions/setup-uv-python
2639
with:
2740
service-path: src/web
@@ -34,7 +47,8 @@ jobs:
3447
run: pnpm run build
3548

3649
lint-web:
37-
needs: build-web
50+
needs: [check-changes, build-web]
51+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
3852
runs-on: ubuntu-latest
3953
defaults:
4054
run:
@@ -44,7 +58,7 @@ jobs:
4458
WEB_DATABASE_URL: psql://web:pass@localhost:5432/web
4559
DJANGO_SETTINGS_MODULE: config.settings.test
4660
steps:
47-
- uses: actions/checkout@v5
61+
- uses: actions/checkout@v6
4862
- uses: ./.github/actions/setup-uv-python
4963
with:
5064
service-path: src/web
@@ -73,7 +87,8 @@ jobs:
7387
run: make lint-schema WEB_UV="cd src/web && uv run"
7488

7589
test-web:
76-
needs: build-web
90+
needs: [check-changes, build-web]
91+
if: github.event_name == 'push' || needs.check-changes.outputs.relevant == 'true'
7792
runs-on: ubuntu-latest
7893
services:
7994
postgresql:
@@ -108,7 +123,7 @@ jobs:
108123
WEB_VECTOR_DB_TYPE: QDRANT
109124
DJANGO_SETTINGS_MODULE: config.settings.test
110125
steps:
111-
- uses: actions/checkout@v5
126+
- uses: actions/checkout@v6
112127
- uses: ./.github/actions/setup-uv-python
113128
with:
114129
service-path: src/web

0 commit comments

Comments
 (0)