Repository navigation
156 lines (132 loc) · 3.93 KB
/
Copy pathci.yml
File metadata and controls
156 lines (132 loc) · 3.93 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Checks and Tests
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Build
working-directory: packages/dataqueue
run: pnpm run build
- name: Run check format
run: pnpm run check-format
- name: Run check exports
working-directory: packages/dataqueue
run: pnpm run check-exports
- name: Run lint
working-directory: packages/dataqueue
run: pnpm run lint
- name: Run test coverage
working-directory: packages/dataqueue
run: pnpm run test:coverage
timeout-minutes: 3
- name: Upload unit coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: packages/dataqueue/coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
name: unit-coverage
fail_ci_if_error: false
e2e:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '24'
- name: Set up pnpm
uses: pnpm/action-setup@v4
- name: Install dependencies
run: pnpm install
- name: Build dataqueue
working-directory: packages/dataqueue
run: pnpm run build
- name: Build react
working-directory: packages/react
run: pnpm run build
- name: Create E2E test database and run migrations
run: |
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "CREATE DATABASE e2e_test;"
PG_DATAQUEUE_DATABASE=postgres://postgres:postgres@localhost:5432/e2e_test pnpm run migrate-dataqueue
working-directory: apps/e2e
- name: Install Playwright browsers
working-directory: apps/e2e
run: npx playwright install --with-deps chromium
- name: Build e2e
working-directory: apps/e2e
run: pnpm run build
- name: Run E2E coverage
working-directory: apps/e2e
run: pnpm run test:e2e:coverage
timeout-minutes: 5
env:
PG_DATAQUEUE_DATABASE: postgres://postgres:postgres@localhost:5432/e2e_test
- name: Upload e2e coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: apps/e2e/coverage/lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
flags: e2e
name: e2e-coverage
fail_ci_if_error: false
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: apps/e2e/playwright-report/
retention-days: 7