-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (48 loc) · 1.52 KB
/
test.yaml
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
name: CI
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
env:
DATABASE_URI: mongodb://root:example@localhost:27017
PORT: 3500
NODE_ENV: production
ACCESS_TOKEN_SECRET_KEY: secret
REFRESH_TOKEN_SECRET_KEY: secret
EMAIL_TOKEN_SECRET_KEY: secret
PASSWORD_RESET_TOKEN_SECRET_KEY: secret
SENDGRID_API_KEY: secret
REDIS_URL: redis://localhost:6379
services:
database:
image: mongo:latest
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
ports:
- 27017:27017
redis:
image: redis:latest
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
matrix:
node-version: ["14.x", "latest"]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run Tests
run: npx jest --detectOpenHandles