Skip to content

E2E tests

E2E tests #1901

Workflow file for this run

name: E2E tests
on:
workflow_dispatch:
schedule:
# Runs at 2 am every day
- cron: '0 2 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
name: Build & Test
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
# TODO(v4): re-enable LOCAL once @apify/storage-local supports v4
storage: [ MEMORY, PLATFORM ]
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Use Node.js 24
uses: actions/setup-node@v7
with:
node-version: 24
package-manager-cache: false
- name: Turbo cache
id: turbo-cache
uses: actions/cache@v6
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-
- name: Setup Apify CLI
uses: apify/setup-apify-cli-action@main
with:
version: 'beta'
token: ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}
- name: Add Apify secrets for E2E tests
run: apify secrets add anthropicApiKey ${{ secrets.ANTHROPIC_API_KEY }}
- uses: apify/workflows/pnpm-install@main
- name: Cache Playwright browsers
if: (matrix.storage != 'PLATFORM')
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright Dependencies
if: (matrix.storage != 'PLATFORM')
timeout-minutes: 10
run: pnpm exec playwright install --with-deps
- name: Build
run: pnpm ci:build
- name: Test with storage ${{ matrix.storage }}
run: pnpm test:e2e
env:
STORAGE_IMPLEMENTATION: ${{ matrix.storage }}
# Provided explicitly: the CLI may store the token in the OS keyring, where the tests can't read it.
APIFY_TOKEN: ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}
APIFY_HTTPBIN_TOKEN: ${{ secrets.APIFY_HTTPBIN_TOKEN }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GITHUB_TOKEN: ${{ github.token }}