-
Notifications
You must be signed in to change notification settings - Fork 118
102 lines (83 loc) · 2.16 KB
/
Copy pathci.yml
File metadata and controls
102 lines (83 loc) · 2.16 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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
env:
CI: true
SKIP_ENV_VALIDATION: "1"
DATABASE_URL: "mongodb://localhost:27017/editron-ci"
AUTH_SECRET: "ci-auth-secret"
AUTH_GITHUB_ID: "ci-github-id"
AUTH_GITHUB_SECRET: "ci-github-secret"
AUTH_GOOGLE_ID: "ci-google-id"
AUTH_GOOGLE_SECRET: "ci-google-secret"
jobs:
lint:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
test:
name: test
runs-on: ubuntu-latest
timeout-minutes: 10
services:
mongodb:
image: mongo:6
ports:
- 27017:27017
options: >-
--health-cmd "echo 'db.runCommand(\"ping\").ok' | mongosh localhost:27017/test --quiet"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run smoke tests
run: npm test
build:
name: build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Cache Next.js build
uses: actions/cache@v4
with:
path: |
~/.npm
${{ github.workspace }}/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Build app
run: npm run build