-
Notifications
You must be signed in to change notification settings - Fork 180
119 lines (112 loc) · 3.66 KB
/
ci.yml
File metadata and controls
119 lines (112 loc) · 3.66 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
name: CI
on:
push:
branches: [main, staging]
paths-ignore:
- "**.md"
- "docs/**"
- ".github/FUNDING.yml"
pull_request:
branches: [main, staging]
paths-ignore:
- "**.md"
- "docs/**"
- ".github/FUNDING.yml"
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.3.11"
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: ${{ runner.os }}-bun-
- run: bun install --frozen-lockfile
- run: bun run lint
test:
name: Test
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 15
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/databuddy_test
REDIS_URL: redis://localhost:6379
REDIS_HOST: localhost
REDIS_PORT: 6379
REDPANDA_BROKER: localhost:9092
REDPANDA_USER: test-redpanda-user
REDPANDA_PASSWORD: test-redpanda-password
DATABUDDY_API_KEY: test-databuddy-api-key
DATABUDDY_WEBSITE_ID: test-databuddy-website-id
BETTER_AUTH_SECRET: test-auth-secret-for-ci-testing-only
BETTER_AUTH_URL: http://localhost:3000
GITHUB_CLIENT_ID: test-github-client-id
GITHUB_CLIENT_SECRET: test-github-client-secret
GOOGLE_CLIENT_ID: test-google-client-id
GOOGLE_CLIENT_SECRET: test-google-client-secret
RESEND_API_KEY: test-resend-api-key
RECAPTCHA_SECRET_KEY: test-recaptcha-secret-key
VERCEL_CLIENT_ID: test-vercel-client-id
VERCEL_CLIENT_SECRET: test-vercel-client-secret
AUTUMN_SECRET_KEY: test-autumn-secret-key
NEXT_PUBLIC_API_URL: http://localhost:3000/api
EMAIL_API_KEY: test-email-api-key
IP_HASH_SALT: test-ip-hash-salt
UPSTASH_QSTASH_TOKEN: test-upstash-qstash-token
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: databuddy_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 2
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.3.11"
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: ${{ runner.os }}-bun-
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: ${{ runner.os }}-turbo-
- run: bun install --frozen-lockfile
- name: Test
env:
NODE_ENV: test
run: bun run test