fix(ci): separate live Reddit tests into integration suite #2
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| name: Build & Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| path: adapter-reddit | |
| - uses: actions/checkout@v4 | |
| with: | |
| repository: browserkit-dev/browserkit | |
| path: browserkit | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install & build @browserkit/core | |
| working-directory: browserkit | |
| run: | | |
| npm install -g pnpm | |
| pnpm install --frozen-lockfile | |
| pnpm --filter @browserkit/core build | |
| - name: Patch @browserkit/core dep path | |
| working-directory: adapter-reddit | |
| run: | | |
| npm pkg set 'devDependencies.@browserkit/core'='file:../browserkit/packages/core' | |
| npm pkg set 'peerDependencies.@browserkit/core'='>=0.1.0' | |
| - name: Install adapter dependencies | |
| working-directory: adapter-reddit | |
| run: npm install | |
| - name: Install Patchright Chromium | |
| working-directory: adapter-reddit | |
| run: npx patchright install chromium --with-deps | |
| - name: Build | |
| working-directory: adapter-reddit | |
| run: npm run build | |
| # L1 unit + L3 structural protocol tests (no Reddit network calls needed) | |
| # Live dispatch tests (get_subreddit, search, get_thread) are in | |
| # *.integration.test.ts — excluded from CI because GitHub Actions IPs | |
| # get 403 from Reddit's API. Run locally with: pnpm test:integration | |
| - name: Test | |
| working-directory: adapter-reddit | |
| run: npm test | |
| timeout-minutes: 5 |