Skip to content

Commit 45fb19e

Browse files
author
Cursor
committed
ci: split proxy integration tests by language with path filters
Run JavaScript, Python, PHP, and Ruby example harnesses in separate workflows; each triggers only when its language directory (or that workflow file) changes. Made-with: Cursor
1 parent e371f00 commit 45fb19e

4 files changed

Lines changed: 152 additions & 1 deletion

File tree

.github/workflows/proxy_integration_tests.yml renamed to .github/workflows/proxy_integration_tests_javascript.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
# status check under branch protection (pull_request events only receive secrets for PRs
44
# from the same repository, not from forks).
55

6-
name: Proxy integration tests
6+
name: Proxy integration tests (JavaScript)
77

88
on:
99
pull_request:
10+
paths:
11+
- "javascript/**"
12+
- ".github/workflows/proxy_integration_tests_javascript.yml"
1013

1114
permissions:
1215
contents: read
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL
2+
# under Settings → Secrets and variables → Actions, then mark this workflow as a required
3+
# status check under branch protection (pull_request events only receive secrets for PRs
4+
# from the same repository, not from forks).
5+
6+
name: Proxy integration tests (PHP)
7+
8+
on:
9+
pull_request:
10+
paths:
11+
- "php/**"
12+
- ".github/workflows/proxy_integration_tests_php.yml"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
integration:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- name: Set up PHP
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: "8.3"
30+
extensions: curl
31+
coverage: none
32+
33+
- name: Install Composer dependencies
34+
working-directory: php
35+
run: composer install --no-interaction --prefer-dist
36+
37+
- name: Require PROXY_URL Actions secret
38+
env:
39+
PROXY_URL: ${{ secrets.PROXY_URL }}
40+
run: |
41+
if [ -z "${PROXY_URL}" ]; then
42+
echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions."
43+
exit 1
44+
fi
45+
46+
- name: Run integration tests
47+
working-directory: php
48+
env:
49+
PROXY_URL: ${{ secrets.PROXY_URL }}
50+
run: php run_tests.php
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL
2+
# under Settings → Secrets and variables → Actions, then mark this workflow as a required
3+
# status check under branch protection (pull_request events only receive secrets for PRs
4+
# from the same repository, not from forks).
5+
6+
name: Proxy integration tests (Python)
7+
8+
on:
9+
pull_request:
10+
paths:
11+
- "python/**"
12+
- ".github/workflows/proxy_integration_tests_python.yml"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
integration:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.x"
30+
31+
- name: Install system dependencies (pycurl)
32+
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
33+
34+
- name: Install python-proxy-headers and example dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install python-proxy-headers requests urllib3 aiohttp httpx cloudscraper autoscraper pycurl
38+
39+
- name: Require PROXY_URL Actions secret
40+
env:
41+
PROXY_URL: ${{ secrets.PROXY_URL }}
42+
run: |
43+
if [ -z "${PROXY_URL}" ]; then
44+
echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions."
45+
exit 1
46+
fi
47+
48+
- name: Run integration tests
49+
working-directory: python
50+
env:
51+
PROXY_URL: ${{ secrets.PROXY_URL }}
52+
run: python run_tests.py
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL
2+
# under Settings → Secrets and variables → Actions, then mark this workflow as a required
3+
# status check under branch protection (pull_request events only receive secrets for PRs
4+
# from the same repository, not from forks).
5+
6+
name: Proxy integration tests (Ruby)
7+
8+
on:
9+
pull_request:
10+
paths:
11+
- "ruby/**"
12+
- ".github/workflows/proxy_integration_tests_ruby.yml"
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
integration:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
23+
with:
24+
persist-credentials: false
25+
26+
- name: Set up Ruby
27+
uses: ruby/setup-ruby@2e007403fc1ec238429ecaa57af6f22f019cc135 # v1.234.0
28+
with:
29+
ruby-version: "3.3"
30+
bundler-cache: true
31+
working-directory: ruby
32+
33+
- name: Require PROXY_URL Actions secret
34+
env:
35+
PROXY_URL: ${{ secrets.PROXY_URL }}
36+
run: |
37+
if [ -z "${PROXY_URL}" ]; then
38+
echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions."
39+
exit 1
40+
fi
41+
42+
- name: Run integration tests
43+
working-directory: ruby
44+
env:
45+
PROXY_URL: ${{ secrets.PROXY_URL }}
46+
run: bundle exec ruby run_tests.rb

0 commit comments

Comments
 (0)