Skip to content

Commit 6257d88

Browse files
author
Cursor
committed
Refactor integration workflow skipping with job-level conditions.
Use a dedicated paths-filter job and gate each integration job with jobs.if so skipped checks stay clean and still satisfy required-check reporting. Made-with: Cursor
1 parent 13d77e9 commit 6257d88

4 files changed

Lines changed: 68 additions & 92 deletions

File tree

.github/workflows/proxy_integration_tests_javascript.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,45 @@ on:
1010

1111
permissions:
1212
contents: read
13+
pull-requests: read
1314

1415
jobs:
16+
changes:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
relevant: ${{ steps.filter.outputs.relevant }}
20+
steps:
21+
- name: Detect JavaScript changes
22+
id: filter
23+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
24+
with:
25+
filters: |
26+
relevant:
27+
- "javascript/**"
28+
- ".github/workflows/proxy_integration_tests_javascript.yml"
29+
1530
integration:
31+
needs: changes
32+
if: needs.changes.outputs.relevant == 'true'
1633
runs-on: ubuntu-latest
1734

1835
steps:
1936
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 (Node 24)
2037
with:
2138
persist-credentials: false
2239

23-
- name: Detect JavaScript changes
24-
id: changes
25-
run: |
26-
set -euo pipefail
27-
changed="false"
28-
while IFS= read -r file; do
29-
case "${file}" in
30-
javascript/*|.github/workflows/proxy_integration_tests_javascript.yml)
31-
changed="true"
32-
break
33-
;;
34-
esac
35-
done < <(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}")
36-
echo "changed=${changed}" >> "${GITHUB_OUTPUT}"
37-
3840
- name: Set up Node
39-
if: steps.changes.outputs.changed == 'true'
4041
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 (Node 24)
4142
with:
4243
node-version: "24"
4344
cache: npm
4445
cache-dependency-path: javascript/package-lock.json
4546

4647
- name: Install dependencies
47-
if: steps.changes.outputs.changed == 'true'
4848
working-directory: javascript
4949
run: npm ci
5050

5151
- name: Require PROXY_URL Actions secret
52-
if: steps.changes.outputs.changed == 'true'
5352
env:
5453
PROXY_URL: ${{ secrets.PROXY_URL }}
5554
run: |
@@ -59,12 +58,7 @@ jobs:
5958
fi
6059
6160
- name: Run integration tests
62-
if: steps.changes.outputs.changed == 'true'
6361
working-directory: javascript
6462
env:
6563
PROXY_URL: ${{ secrets.PROXY_URL }}
6664
run: npm test
67-
68-
- name: Skip when JavaScript files are unchanged
69-
if: steps.changes.outputs.changed != 'true'
70-
run: echo "No JavaScript integration test changes detected; skipping."

.github/workflows/proxy_integration_tests_php.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,46 +10,45 @@ on:
1010

1111
permissions:
1212
contents: read
13+
pull-requests: read
1314

1415
jobs:
16+
changes:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
relevant: ${{ steps.filter.outputs.relevant }}
20+
steps:
21+
- name: Detect PHP changes
22+
id: filter
23+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
24+
with:
25+
filters: |
26+
relevant:
27+
- "php/**"
28+
- ".github/workflows/proxy_integration_tests_php.yml"
29+
1530
integration:
31+
needs: changes
32+
if: needs.changes.outputs.relevant == 'true'
1633
runs-on: ubuntu-latest
1734

1835
steps:
1936
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 (Node 24)
2037
with:
2138
persist-credentials: false
2239

23-
- name: Detect PHP changes
24-
id: changes
25-
run: |
26-
set -euo pipefail
27-
changed="false"
28-
while IFS= read -r file; do
29-
case "${file}" in
30-
php/*|.github/workflows/proxy_integration_tests_php.yml)
31-
changed="true"
32-
break
33-
;;
34-
esac
35-
done < <(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}")
36-
echo "changed=${changed}" >> "${GITHUB_OUTPUT}"
37-
3840
- name: Set up PHP
39-
if: steps.changes.outputs.changed == 'true'
4041
uses: shivammathur/setup-php@v2
4142
with:
4243
php-version: "8.3"
4344
extensions: curl
4445
coverage: none
4546

4647
- name: Install Composer dependencies
47-
if: steps.changes.outputs.changed == 'true'
4848
working-directory: php
4949
run: composer install --no-interaction --prefer-dist
5050

5151
- name: Require PROXY_URL Actions secret
52-
if: steps.changes.outputs.changed == 'true'
5352
env:
5453
PROXY_URL: ${{ secrets.PROXY_URL }}
5554
run: |
@@ -59,12 +58,7 @@ jobs:
5958
fi
6059
6160
- name: Run integration tests
62-
if: steps.changes.outputs.changed == 'true'
6361
working-directory: php
6462
env:
6563
PROXY_URL: ${{ secrets.PROXY_URL }}
6664
run: php run_tests.php
67-
68-
- name: Skip when PHP files are unchanged
69-
if: steps.changes.outputs.changed != 'true'
70-
run: echo "No PHP integration test changes detected; skipping."

.github/workflows/proxy_integration_tests_python.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,48 @@ on:
1010

1111
permissions:
1212
contents: read
13+
pull-requests: read
1314

1415
jobs:
16+
changes:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
relevant: ${{ steps.filter.outputs.relevant }}
20+
steps:
21+
- name: Detect Python changes
22+
id: filter
23+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
24+
with:
25+
filters: |
26+
relevant:
27+
- "python/**"
28+
- ".github/workflows/proxy_integration_tests_python.yml"
29+
1530
integration:
31+
needs: changes
32+
if: needs.changes.outputs.relevant == 'true'
1633
runs-on: ubuntu-latest
1734

1835
steps:
1936
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 (Node 24)
2037
with:
2138
persist-credentials: false
2239

23-
- name: Detect Python changes
24-
id: changes
25-
run: |
26-
set -euo pipefail
27-
changed="false"
28-
while IFS= read -r file; do
29-
case "${file}" in
30-
python/*|.github/workflows/proxy_integration_tests_python.yml)
31-
changed="true"
32-
break
33-
;;
34-
esac
35-
done < <(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}")
36-
echo "changed=${changed}" >> "${GITHUB_OUTPUT}"
37-
3840
- name: Set up Python
39-
if: steps.changes.outputs.changed == 'true'
4041
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 (Node 24)
4142
with:
4243
# Pin for reproducible dependency wheels (pycurl, etc.); adjust as needed.
4344
python-version: "3.12"
4445

4546
- name: Install system dependencies (pycurl)
46-
if: steps.changes.outputs.changed == 'true'
4747
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
4848

4949
- name: Install example dependencies
50-
if: steps.changes.outputs.changed == 'true'
5150
run: |
5251
python -m pip install --upgrade pip
5352
pip install -r python/requirements.txt
5453
5554
- name: Require PROXY_URL Actions secret
56-
if: steps.changes.outputs.changed == 'true'
5755
env:
5856
PROXY_URL: ${{ secrets.PROXY_URL }}
5957
run: |
@@ -63,12 +61,7 @@ jobs:
6361
fi
6462
6563
- name: Run integration tests
66-
if: steps.changes.outputs.changed == 'true'
6764
working-directory: python
6865
env:
6966
PROXY_URL: ${{ secrets.PROXY_URL }}
7067
run: python run_tests.py
71-
72-
- name: Skip when Python files are unchanged
73-
if: steps.changes.outputs.changed != 'true'
74-
run: echo "No Python integration test changes detected; skipping."

.github/workflows/proxy_integration_tests_ruby.yml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,41 @@ on:
1010

1111
permissions:
1212
contents: read
13+
pull-requests: read
1314

1415
jobs:
16+
changes:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
relevant: ${{ steps.filter.outputs.relevant }}
20+
steps:
21+
- name: Detect Ruby changes
22+
id: filter
23+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
24+
with:
25+
filters: |
26+
relevant:
27+
- "ruby/**"
28+
- ".github/workflows/proxy_integration_tests_ruby.yml"
29+
1530
integration:
31+
needs: changes
32+
if: needs.changes.outputs.relevant == 'true'
1633
runs-on: ubuntu-latest
1734

1835
steps:
1936
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 (Node 24)
2037
with:
2138
persist-credentials: false
2239

23-
- name: Detect Ruby changes
24-
id: changes
25-
run: |
26-
set -euo pipefail
27-
changed="false"
28-
while IFS= read -r file; do
29-
case "${file}" in
30-
ruby/*|.github/workflows/proxy_integration_tests_ruby.yml)
31-
changed="true"
32-
break
33-
;;
34-
esac
35-
done < <(git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}")
36-
echo "changed=${changed}" >> "${GITHUB_OUTPUT}"
37-
3840
- name: Set up Ruby
39-
if: steps.changes.outputs.changed == 'true'
4041
uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 (Node 24)
4142
with:
4243
ruby-version: "3.3"
4344
bundler-cache: true
4445
working-directory: ruby
4546

4647
- name: Require PROXY_URL Actions secret
47-
if: steps.changes.outputs.changed == 'true'
4848
env:
4949
PROXY_URL: ${{ secrets.PROXY_URL }}
5050
run: |
@@ -54,12 +54,7 @@ jobs:
5454
fi
5555
5656
- name: Run integration tests
57-
if: steps.changes.outputs.changed == 'true'
5857
working-directory: ruby
5958
env:
6059
PROXY_URL: ${{ secrets.PROXY_URL }}
6160
run: bundle exec ruby run_tests.rb
62-
63-
- name: Skip when Ruby files are unchanged
64-
if: steps.changes.outputs.changed != 'true'
65-
run: echo "No Ruby integration test changes detected; skipping."

0 commit comments

Comments
 (0)