Repository navigation
39 lines (35 loc) · 1.56 KB
/
Copy pathtests.yml
File metadata and controls
39 lines (35 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Tests
# Offline: the live API tests skip without SCRAPFLY_KEY.
on:
push:
pull_request:
permissions:
contents: read
jobs:
# Each Python supported, with the oldest and with the newest release of every dependency setup.py allows: a lower
# bound the SDK no longer runs on fails in a lowest job, a new release it breaks on in a highest job.
unit:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.12', '3.13', '3.14', '3.15']
dependencies: ['lowest', 'highest']
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
# lxml, which Scrapy needs, publishes no wheel for Python 3.15 yet: it builds from source.
- if: matrix.python-version == '3.15'
run: sudo apt-get update -q && sudo apt-get install -y --no-install-recommends libxml2-dev libxslt1-dev zlib1g-dev
- run: pip install uv
# Scrapy 2.11 allows Twisted and w3lib releases it does not import with: the constraints hold them where it runs.
- if: matrix.dependencies == 'lowest'
run: |
printf 'Twisted<24.7\nw3lib<2.2\n' > "$RUNNER_TEMP/constraints.txt"
uv pip install --system --resolution lowest-direct --constraint "$RUNNER_TEMP/constraints.txt" ".[speedups,webhook-server,scrapy,sentry]"
- if: matrix.dependencies == 'highest'
run: uv pip install --system ".[speedups,webhook-server,scrapy,sentry]"
- run: uv pip install --system pytest
- run: python -m pytest -q