-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (107 loc) · 3.13 KB
/
Copy pathci.yml
File metadata and controls
136 lines (107 loc) · 3.13 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
name: CI
on:
push:
branches:
- "**"
pull_request:
branches:
- main
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Enable corepack
run: corepack enable pnpm
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci --error-on-warnings .
- name: Run Tailwind lint
run: pnpm run lint:tailwind
- name: Type check
run: pnpm run typecheck
- name: markdownlint
uses: DavidAnson/markdownlint-cli2-action@v24
with:
globs: "**/*.md"
test:
runs-on: ubuntu-latest
needs: check
services:
postgres:
image: postgres:16
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U postgres"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
DATABASE_URL: postgres://postgres@localhost:5432/postgres
APP_BASE_URL: http://127.0.0.1:3100
GITHUB_OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
GITHUB_OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
GITHUB_ALLOWED_ORG: ${{ secrets.OAUTH_ALLOWED_ORG }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Enable corepack
run: corepack enable pnpm
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate session secret
run: |
SESSION_SECRET=$(openssl rand -hex 32)
echo "::add-mask::$SESSION_SECRET"
echo "SESSION_SECRET=$SESSION_SECRET" >> $GITHUB_ENV
- name: Ensure Docker is ready
run: |
for attempt in {1..5}; do
if docker info >/dev/null 2>&1; then
echo "Docker daemon is ready."
exit 0
fi
echo "Docker is not ready yet (attempt ${attempt}/5). Retrying in 5s..."
sleep 5
done
echo "Docker daemon did not become ready in time." >&2
exit 1
- name: Run unit tests
run: pnpm run test
- name: Run database integration tests
run: pnpm run test:db
- name: Install Playwright Browser Dependencies
run: pnpm exec playwright install --with-deps
- name: Run Playwright E2E tests
run: pnpm run test:e2e
image-build:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build production image
run: docker build . --file Dockerfile --tag github-dashboard:test