Skip to content

ci: bump actions/checkout and setup-python #19

ci: bump actions/checkout and setup-python

ci: bump actions/checkout and setup-python #19

# 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:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
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 package and test dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install urllib3 requests aiohttp httpx pycurl
- name: Run header security unit tests
run: python test_header_security.py
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
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 package and test dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install urllib3 requests aiohttp httpx cloudscraper autoscraper pycurl
- name: Require PROXY_URL Actions secret
id: proxy_url
env:
PROXY_URL: ${{ secrets.PROXY_URL }}
run: |
if [ -n "${PROXY_URL}" ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
exit 0
fi
# Dependabot PRs do not receive repository Actions secrets unless the same
# values are also configured under Settings → Secrets → Dependabot.
if [ "${{ github.actor }}" = "dependabot[bot]" ]; then
echo "::notice::Skipping integration tests: PROXY_URL is not available to Dependabot. Add it under Settings → Secrets → Dependabot to run these checks on Dependabot PRs."
echo "available=false" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "::error::PROXY_URL is not set. Add a repository (or environment) secret named PROXY_URL under Settings → Secrets and variables → Actions."
exit 1
- name: Run integration tests
if: steps.proxy_url.outputs.available == 'true'
env:
PROXY_URL: ${{ secrets.PROXY_URL }}
run: python test_proxy_headers.py