Skip to content

Commit 9378c23

Browse files
Add CI/CD workflow
1 parent 37bc651 commit 9378c23

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI/CD Pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
services:
16+
docker:
17+
image: docker:20.10.7
18+
options: --privileged
19+
ports:
20+
- 4566:4566
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v2
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v2
28+
with:
29+
node-version: "18.18.0"
30+
31+
- name: Install dependencies
32+
run: npm install
33+
34+
- name: Build project
35+
run: npm run build
36+
37+
- name: Start local services
38+
run: |
39+
docker-compose up -d
40+
41+
- name: Wait for local services to start
42+
run: |
43+
npm run wait-for-docker
44+
45+
- name: Start local database
46+
run: npm run start:db
47+
48+
- name: Seed local database
49+
run: npm run seed:local-db
50+
51+
- name: Start local API gateway and lambda
52+
run: start:local-api
53+
54+
- name: Run tests with handler
55+
run: npm run test:handler
56+
57+
- name: Run tests with localstack
58+
run: npm run test:e2e

0 commit comments

Comments
 (0)