-
Notifications
You must be signed in to change notification settings - Fork 36
56 lines (47 loc) · 1.79 KB
/
Copy pathtest_python_templates.yaml
File metadata and controls
56 lines (47 loc) · 1.79 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Test Python templates
on:
workflow_call:
jobs:
test-python-templates:
name: Test Python templates
strategy:
matrix:
os: [ubuntu-24.04, windows-latest]
python-version: ['3.11', '3.12', '3.13', '3.14']
# Duration-balanced template slice, see TEST_SHARD in test/templates.test.js.
shard: ['1/2', '2/2']
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- name: Checkout repo
uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
- name: Install pnpm and dependencies
uses: apify/workflows/pnpm-install@v0.46.0
- name: Install playwright browsers
run: pnpm exec playwright install chromium --with-deps
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: templates/**/requirements.txt
- name: Install Chrome and Chromedriver
# Use pnpm dlx instead of npx — npx is the npm CLI and trips
# devEngines.packageManager=pnpm at the repo root.
run: |
pnpm dlx @puppeteer/browsers install chrome
pnpm dlx @puppeteer/browsers install chromedriver
- name: Test Python templates
run: pnpm run test-python-templates
env:
TEST_SHARD: ${{ matrix.shard }}
# The camoufox browser fetch hits the GitHub releases API —
# unauthenticated it flakes on runner-IP rate limits.
GITHUB_TOKEN: ${{ github.token }}
APIFY_TOKEN: ${{ secrets.APIFY_TEST_USER_API_TOKEN }}
OPENAI_API_KEY: ${{ secrets.APIFY_SERVICE_ACCOUNT_OPENAI_API_KEY }}