-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (98 loc) · 2.35 KB
/
test.yml
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
name: Tests Pipeline
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches: [ main ]
types: [ opened, synchronize ]
jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: npm ci
- name: Create Swagger File
run: npm run swagger:create
- name: Lint Swagger File
run: npm run swagger:lint
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install Dependencies
run: npm ci
- name: Create Docs
run: npm run swagger:create
- name: Lint Swagger File
run: npm run swagger:lint
- name: Lint Codebase
run: npm run lint-ci
build-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Docker
run: docker build .
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: superhero
POSTGRES_HOST_PORT: 5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ipfs:
image: ipfs/kubo
ports:
- 5001:5001
options: >-
--health-cmd "ipfs swarm peers"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 100
- name: List running containers
run: docker ps
- name: Run npm install
run: npm ci
- name: Create Docs
run: npm run swagger:create
- name: Run db migration
run: npm run db:create
- name: Run tests
run: npm run test