-
-
Notifications
You must be signed in to change notification settings - Fork 27
89 lines (89 loc) · 2.53 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Tests
env:
CI: true
on:
push:
branches: [canary]
paths:
- 'apps/cache-testing/**'
- 'packages/cache-handler/**'
- 'internal/next-common/**'
- 'internal/next-lru-cache/**'
- 'server/**'
- '.github/workflows/tests.yml'
- 'internal/eslint-config/**'
- 'internal/prettier-config/**'
- 'package.json'
- 'biome.json'
- 'turbo.json'
- '.prettierrc.json'
pull_request:
branches: [canary]
paths:
- 'apps/cache-testing/**'
- 'packages/cache-handler/**'
- 'internal/next-common/**'
- 'internal/next-lru-cache/**'
- 'server/**'
- '.github/workflows/tests.yml'
- 'internal/eslint-config/**'
- 'internal/prettier-config/**'
- 'package.json'
- 'biome.json'
- 'turbo.json'
- '.prettierrc.json'
jobs:
test:
strategy:
max-parallel: 2
matrix:
handler: [redis-stack, redis-strings]
name: ${{ matrix.handler }}
timeout-minutes: 10
runs-on: ubuntu-latest
env:
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'
check-latest: true
cache: 'npm'
- name: Replace Path with Sed
run: |
if [ "${{ matrix.handler }}" == "redis-strings" ]; then
sed -i 's/cache-handler-redis-stack/cache-handler-redis-strings/g' apps/cache-testing/next.config.mjs
sed -i 's/cache-handler-redis-stack/cache-handler-redis-strings/g' apps/cache-testing/src/instrumentation.ts
fi
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npm run playwright:install -w @repo/cache-testing
- name: Build packages
run: npm run build:packages
- name: Check code style
run: npm run codestyle:check
- name: Run unit tests
run: npm test
- name: Run e2e tests
run: |
npm run start:backend &
npm run build:test-app
npm run e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.handler }}
path: apps/cache-testing/playwright-report/
retention-days: 7