Update GitHub Actions workflows to run only on specific paths (#593) #1354
This file contains 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: Tests | |
on: | |
push: | |
branches: [canary] | |
paths: | |
- 'apps/cache-testing/**' | |
- 'packages/cache-handler/**' | |
- 'internal/next-common/**' | |
- 'internal/next-lru-cache/**' | |
- 'server/**' | |
- '.github/workflows/tests.yml' | |
pull_request: | |
branches: [canary] | |
paths: | |
- 'apps/cache-testing/**' | |
- 'packages/cache-handler/**' | |
- 'internal/next-common/**' | |
- 'internal/next-lru-cache/**' | |
- 'server/**' | |
- '.github/workflows/tests.yml' | |
jobs: | |
test: | |
name: 'redis-stack' | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
env: | |
HANDLER_PATH: ./cache-handler-redis-stack.mjs | |
REDIS_URL: redis://localhost:6379 | |
services: | |
redis: | |
image: redis/redis-stack-server:latest | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 6379:6379 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npm run playwright:install -w apps/cache-testing | |
- name: Build | |
run: npm run build | |
- name: Check code style | |
run: npm run codestyle:check | |
- name: Run unit tests | |
run: npm test | |
- name: Run e2e tests | |
run: | | |
npm run start -w backend & | |
npm run build:app | |
npm run e2e | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: apps/cache-testing/playwright-report/ | |
retention-days: 7 |