E2E scraper tests #257
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 scraper tests | |
| env: | |
| PUPPETEER_DOWNLOAD_BASE_URL: https://storage.googleapis.com/chrome-for-testing-public | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| # Runs at 2 am every day | |
| - cron: '0 2 * * *' | |
| jobs: | |
| build_and_test: | |
| name: Build & Test | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Cancel Workflow Action | |
| uses: styfle/cancel-workflow-action@0.13.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Use Node.js 24 | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| - 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: Install pnpm and dependencies | |
| uses: apify/actions/pnpm-install@v1.4.0 | |
| - name: Install browsers | |
| run: | | |
| pnpm exec puppeteer browsers install chrome | |
| pnpm exec playwright install chromium | |
| - name: Build | |
| run: pnpm ci:build | |
| # ubuntu-24.04 restricts unprivileged user namespaces via AppArmor, which breaks | |
| # Chrome's sandbox and fails the browser-launch tests. Re-enable it for the runner. | |
| - name: Enable unprivileged user namespaces (Chrome sandbox) | |
| run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - name: Test | |
| run: pnpm test:e2e | |
| env: | |
| APIFY_TOKEN: ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }} |