1- # This is a basic workflow to help you get started with Actions
2-
31name : CI
42
5- on :
6- push :
7- branches : [master]
8- pull_request :
9- branches : [master]
3+ on : [push]
104
115jobs :
126 build :
@@ -19,40 +13,37 @@ jobs:
1913 - name : Setup Node.js environment
2014 uses : actions/setup-node@v3
2115 with :
22- node-version : 16
16+ node-version : ' 14.16.1 '
2317
2418 - name : Install npm dependencies
2519 run : npm ci
2620
21+ - name : Prisma generate
22+ run : npm run prisma:generate
23+
2724 - name : Unit tests
2825 run : npm run test:cov
2926
30- - name : Codacy Coverage Reporter
31- uses : codacy/codacy-coverage-reporter-action@v1
32- with :
33- project-token : ${{ secrets.CODACY_TOKEN }}
34-
35- - name : Setup PostgreSQL
36- uses : Harmon758/postgresql-action@v1
37- with :
38- postgresql db : vrt_db_dev
39- postgresql user : postgres
40- postgresql password : postgres
27+ - name : Build and run containers
28+ run : docker-compose up --build -d
4129
4230 # FIXME: This action is unmaintained.
43- - name : Wait untill DB started (workaround of https://github.com/Harmon758/postgresql-action/issues/7 )
31+ - name : Wait untill service started (replace with health status check )
4432 uses :
jakejarvis/[email protected] 4533 with :
46- time : ' 5s '
34+ time : ' 10s '
4735
48- - name : Apply Manual DB migrations
49- run : npx ts-node ./prisma/manual_migrations.ts
50-
51- - name : Apply DB migrations
52- run : npx prisma migrate up -c --experimental
53-
54- - name : Seed DB data
55- run : npx ts-node ./prisma/seed.ts
36+ - name : Run acceptance tests
37+ run : npm run test:acceptance
5638
5739 - name : Run e2e tests
5840 run : npm run test:e2e
41+
42+ - name : Stop containers
43+ if : always()
44+ run : docker-compose down
45+
46+ - name : Codacy Coverage Reporter
47+ uses : codacy/codacy-coverage-reporter-action@v1
48+ with :
49+ project-token : ${{ secrets.CODACY_TOKEN }}
0 commit comments