-
-
Notifications
You must be signed in to change notification settings - Fork 38
99 lines (89 loc) · 2.55 KB
/
Copy pathtests.yml
File metadata and controls
99 lines (89 loc) · 2.55 KB
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
90
91
92
93
94
95
96
97
98
99
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/**'
- 'package.json'
- 'turbo.json'
- 'prettier.config.js'
pull_request:
branches: [canary]
types: [opened, synchronize]
paths:
- 'apps/cache-testing/**'
- 'packages/cache-handler/**'
- 'internal/next-common/**'
- 'internal/next-lru-cache/**'
- 'server/**'
- '.github/workflows/tests.yml'
- 'internal/eslint-config/**'
- 'package.json'
- 'turbo.json'
- 'prettier.config.js'
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:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
check-latest: true
cache: 'pnpm'
- 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.ts
sed -i 's/cache-handler-redis-stack/cache-handler-redis-strings/g' apps/cache-testing/src/instrumentation.ts
fi
- name: Install dependencies
run: pnpm i --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm -F @repo/cache-testing playwright:install
- name: Build packages
run: pnpm build:packages
- name: Check code style
run: pnpm codestyle:check
- name: Run unit tests
run: pnpm test
- name: Run e2e tests
run: |
pnpm start:backend &
pnpm build:test-app
pnpm e2e
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.handler }}
path: apps/cache-testing/playwright-report/
retention-days: 7