E2E tests #1860
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E tests | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Runs at 2 am every day | |
| - cron: '0 2 * * *' | |
| env: | |
| YARN_IGNORE_NODE: 1 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # NPM install is done in a separate job and cached to speed up the following jobs. | |
| build_and_test: | |
| name: Build & Test | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| storage: [ LOCAL, 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: Enable corepack | |
| run: | | |
| corepack enable | |
| corepack prepare yarn@stable --activate | |
| - name: Activate cache for Node.js 24 | |
| uses: actions/setup-node@v7 | |
| with: | |
| cache: 'yarn' | |
| - 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 }} | |
| - name: Install Dependencies | |
| run: yarn | |
| - name: Cache Playwright browsers | |
| if: (matrix.storage != 'PLATFORM') | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }} | |
| restore-keys: | | |
| playwright-${{ runner.os }}- | |
| - name: Install Playwright Dependencies | |
| if: (matrix.storage != 'PLATFORM') | |
| timeout-minutes: 10 | |
| run: yarn playwright install --with-deps | |
| - name: Build | |
| run: yarn ci:build | |
| - name: Test with storage ${{ matrix.storage }} | |
| run: yarn 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 }} |