From e371f009924bc6abeecabea9fe70cc95750838bf Mon Sep 17 00:00:00 2001 From: Cursor Date: Sun, 5 Apr 2026 03:30:44 +0000 Subject: [PATCH 1/2] ci: add proxy integration tests workflow Made-with: Cursor --- .github/workflows/proxy_integration_tests.yml | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/proxy_integration_tests.yml diff --git a/.github/workflows/proxy_integration_tests.yml b/.github/workflows/proxy_integration_tests.yml new file mode 100644 index 0000000..5959d0b --- /dev/null +++ b/.github/workflows/proxy_integration_tests.yml @@ -0,0 +1,47 @@ +# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL +# under Settings → Secrets and variables → Actions, then mark this workflow as a required +# status check under branch protection (pull_request events only receive secrets for PRs +# from the same repository, not from forks). + +name: Proxy integration tests + +on: + pull_request: + +permissions: + contents: read + +jobs: + integration: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "24" + cache: npm + cache-dependency-path: javascript/package-lock.json + + - name: Install dependencies + working-directory: javascript + run: npm ci + + - name: Require PROXY_URL Actions secret + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: | + if [ -z "${PROXY_URL}" ]; then + echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions." + exit 1 + fi + + - name: Run integration tests + working-directory: javascript + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: npm test From 45fb19e0061c71cb253c412b85417a9b66a71d91 Mon Sep 17 00:00:00 2001 From: Cursor Date: Sun, 5 Apr 2026 04:14:14 +0000 Subject: [PATCH 2/2] 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 --- ...=> proxy_integration_tests_javascript.yml} | 5 +- .../workflows/proxy_integration_tests_php.yml | 50 ++++++++++++++++++ .../proxy_integration_tests_python.yml | 52 +++++++++++++++++++ .../proxy_integration_tests_ruby.yml | 46 ++++++++++++++++ 4 files changed, 152 insertions(+), 1 deletion(-) rename .github/workflows/{proxy_integration_tests.yml => proxy_integration_tests_javascript.yml} (90%) create mode 100644 .github/workflows/proxy_integration_tests_php.yml create mode 100644 .github/workflows/proxy_integration_tests_python.yml create mode 100644 .github/workflows/proxy_integration_tests_ruby.yml diff --git a/.github/workflows/proxy_integration_tests.yml b/.github/workflows/proxy_integration_tests_javascript.yml similarity index 90% rename from .github/workflows/proxy_integration_tests.yml rename to .github/workflows/proxy_integration_tests_javascript.yml index 5959d0b..25c4aa1 100644 --- a/.github/workflows/proxy_integration_tests.yml +++ b/.github/workflows/proxy_integration_tests_javascript.yml @@ -3,10 +3,13 @@ # status check under branch protection (pull_request events only receive secrets for PRs # from the same repository, not from forks). -name: Proxy integration tests +name: Proxy integration tests (JavaScript) on: pull_request: + paths: + - "javascript/**" + - ".github/workflows/proxy_integration_tests_javascript.yml" permissions: contents: read diff --git a/.github/workflows/proxy_integration_tests_php.yml b/.github/workflows/proxy_integration_tests_php.yml new file mode 100644 index 0000000..d20ced9 --- /dev/null +++ b/.github/workflows/proxy_integration_tests_php.yml @@ -0,0 +1,50 @@ +# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL +# under Settings → Secrets and variables → Actions, then mark this workflow as a required +# status check under branch protection (pull_request events only receive secrets for PRs +# from the same repository, not from forks). + +name: Proxy integration tests (PHP) + +on: + pull_request: + paths: + - "php/**" + - ".github/workflows/proxy_integration_tests_php.yml" + +permissions: + contents: read + +jobs: + integration: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.3" + extensions: curl + coverage: none + + - name: Install Composer dependencies + working-directory: php + run: composer install --no-interaction --prefer-dist + + - name: Require PROXY_URL Actions secret + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: | + if [ -z "${PROXY_URL}" ]; then + echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions." + exit 1 + fi + + - name: Run integration tests + working-directory: php + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: php run_tests.php diff --git a/.github/workflows/proxy_integration_tests_python.yml b/.github/workflows/proxy_integration_tests_python.yml new file mode 100644 index 0000000..8f85aab --- /dev/null +++ b/.github/workflows/proxy_integration_tests_python.yml @@ -0,0 +1,52 @@ +# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL +# under Settings → Secrets and variables → Actions, then mark this workflow as a required +# status check under branch protection (pull_request events only receive secrets for PRs +# from the same repository, not from forks). + +name: Proxy integration tests (Python) + +on: + pull_request: + paths: + - "python/**" + - ".github/workflows/proxy_integration_tests_python.yml" + +permissions: + contents: read + +jobs: + integration: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install system dependencies (pycurl) + run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev + + - name: Install python-proxy-headers and example dependencies + run: | + python -m pip install --upgrade pip + pip install python-proxy-headers requests urllib3 aiohttp httpx cloudscraper autoscraper pycurl + + - name: Require PROXY_URL Actions secret + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: | + if [ -z "${PROXY_URL}" ]; then + echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions." + exit 1 + fi + + - name: Run integration tests + working-directory: python + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: python run_tests.py diff --git a/.github/workflows/proxy_integration_tests_ruby.yml b/.github/workflows/proxy_integration_tests_ruby.yml new file mode 100644 index 0000000..e9f6ebf --- /dev/null +++ b/.github/workflows/proxy_integration_tests_ruby.yml @@ -0,0 +1,46 @@ +# Integration tests against a real proxy (PROXY_URL). Add repository secret PROXY_URL +# under Settings → Secrets and variables → Actions, then mark this workflow as a required +# status check under branch protection (pull_request events only receive secrets for PRs +# from the same repository, not from forks). + +name: Proxy integration tests (Ruby) + +on: + pull_request: + paths: + - "ruby/**" + - ".github/workflows/proxy_integration_tests_ruby.yml" + +permissions: + contents: read + +jobs: + integration: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + persist-credentials: false + + - name: Set up Ruby + uses: ruby/setup-ruby@2e007403fc1ec238429ecaa57af6f22f019cc135 # v1.234.0 + with: + ruby-version: "3.3" + bundler-cache: true + working-directory: ruby + + - name: Require PROXY_URL Actions secret + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: | + if [ -z "${PROXY_URL}" ]; then + echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions." + exit 1 + fi + + - name: Run integration tests + working-directory: ruby + env: + PROXY_URL: ${{ secrets.PROXY_URL }} + run: bundle exec ruby run_tests.rb