-
-
Notifications
You must be signed in to change notification settings - Fork 127
157 lines (123 loc) · 3.51 KB
/
ci.yml
File metadata and controls
157 lines (123 loc) · 3.51 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
157
name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
DATABASE_URL: ${{ secrets.DATABASE_URL }}
UPSTASH_REDIS_REST_URL: ${{ secrets.UPSTASH_REDIS_REST_URL }}
UPSTASH_REDIS_REST_TOKEN: ${{ secrets.UPSTASH_REDIS_REST_TOKEN }}
IP_ADDRESS_SALT: ${{ secrets.IP_ADDRESS_SALT }}
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
GITHUB_CLIENT_ID: ${{ secrets.GH_CLIENT_ID }}
GITHUB_CLIENT_SECRET: ${{ secrets.GH_CLIENT_SECRET }}
jobs:
tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run unit tests
run: bun test:unit
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run Oxlint
run: bun lint
spellcheck:
name: Spell Check
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run cspell
run: bun lint:spell
types:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run type check
run: bun typecheck
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run Oxfmt format check
run: bun format:check
knip:
name: Knip
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run Knip
run: bun knip
i18n:
name: i18n
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Run i18n check
run: bun check:i18n
e2e:
name: End-to-end Tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Configure environment
uses: ./.github/actions/setup
- name: Install Playwright with dependencies
run: bun playwright install --with-deps chromium --only-shell
- name: Build apps
run: bun run build
- name: Run services
run: docker compose up -d
- name: Verify Postgres is ready
run: |
until docker exec $(docker ps -qf "name=nelsonlaidev-postgres") pg_isready; do
echo "Waiting for database..."
sleep 2
done
- name: Migrate database
run: bun db:migrate
- name: Seed database
run: bun db:seed
- name: Run Playwright tests
run: bun test:e2e
- name: Upload Playwright report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: playwright-report/
retention-days: 30