-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (69 loc) · 1.59 KB
/
api-ci.yml
File metadata and controls
74 lines (69 loc) · 1.59 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
name: API CI
#on: [push]
on:
push:
paths:
- "api/**"
- ".github/workflows/api-ci.yml"
defaults:
run:
working-directory: ./api
jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: ./api/package-lock.json
- name: install
shell: bash
run: npm ci
- name: run linter
shell: bash
run: npm run lint
unit-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nodejs
uses: actions/setup-node@v4
with:
node-version: 22
cache: "npm"
cache-dependency-path: ./api/package-lock.json
- name: install
shell: bash
run: npm ci
- name: run unit test
shell: bash
run: npm run test
e2e:
runs-on: ubuntu-latest
container:
image: node:22
services:
mongo-e2e:
image: mongo:7
ports:
- 27017:27017
env:
MONGO_INITDB_ROOT_USERNAME: test
MONGO_INITDB_ROOT_PASSWORD: test123
steps:
- name: Checkout
uses: actions/checkout@v2
- name: install
shell: bash
run: npm install
- name: run e2e
shell: bash
run: npm run test:e2e
env:
MONGO_DB_NAME: demo
MONGO_URL: mongodb://test:test123@mongo-e2e:27017?retryWrites=true&writeConcern=majority