Skip to content

Commit 4caa2f3

Browse files
committed
Change to skip entire jobs
1 parent f8ab96b commit 4caa2f3

1 file changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/run_tests.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,33 @@ jobs:
136136
files: coverage*.xml
137137
fail_ci_if_error: true
138138

139+
changed-files:
140+
name: Get changed files
141+
runs-on: ubuntu-latest
142+
outputs:
143+
changed-files: ${{ steps.changed-files.outputs.any_changed == 'true'}}
144+
steps:
145+
- name: Set up Git repository
146+
uses: actions/checkout@v4
147+
with:
148+
fetch-depth: 0
149+
150+
- name: Get all changed files
151+
id: changed-files
152+
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46
153+
with:
154+
files: |
155+
tesseract_core/**
156+
tests/endtoend_tests/**
157+
demo/**
158+
examples/**
159+
production.uv.lock
160+
.github/workflows/run_tests.yml
161+
162+
139163
get-e2e-matrix:
164+
needs: [ changed-files ]
165+
if: needs.changed-files.outputs.changed-files == 'true'
140166
runs-on: ubuntu-latest
141167

142168
outputs:
@@ -176,7 +202,8 @@ jobs:
176202
printf 'matrix=%s' "$subjobs" >> $GITHUB_OUTPUT
177203
178204
tests-e2e:
179-
needs: get-e2e-matrix
205+
needs: [get-e2e-matrix, changed-files]
206+
if: needs.changed-files.outputs.changed-files == 'true'
180207

181208
strategy:
182209
matrix:
@@ -287,6 +314,9 @@ jobs:
287314
fail_ci_if_error: true
288315

289316
tests-demos:
317+
needs: [changed-files]
318+
if: needs.changed-files.outputs.changed-files == 'true'
319+
290320
strategy:
291321
matrix:
292322
os: [ubuntu-latest]

0 commit comments

Comments
 (0)