-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (99 loc) · 2.91 KB
/
main.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
name: EMSE-API - Main pipeline
on:
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
- name: Export DB URL
run: echo "DATABASE_URL=${{secrets.DATABASE_URL}}" > .env
- name: Generate Prisma types
run: yarn generate
- name: Build application
run: yarn nest build
test:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
- name: Export environment variables
run: echo "DATABASE_URL=${{secrets.DATABASE_URL}}" > .env
- name: Generate types
run: yarn generate
- name: Run test suite
run: yarn vitest
coverage:
needs: [test]
runs-on: ubuntu-latest
name: Create Coverage Report
steps:
- uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
- name: Export environment variables
run: echo "DATABASE_URL=${{secrets.DATABASE_URL}}" > .env
- name: Build types
run: yarn generate
- name: Run tests and collect coverage
run: yarn vitest --coverage
- name: Upload coverage reports to Codecov
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ba891e32-a8ac-42aa-be84-f7ad7837b34f
docs:
runs-on: ubuntu-latest
name: Create Docs
steps:
- uses: actions/checkout@v3
- name: Use Node
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Install dependencies
run: yarn
- name: Export environment variables
run: echo "DATABASE_URL=${{secrets.DATABASE_URL}}" > .env
- name: Build types
run: yarn generate
- name: Generate docs
run: yarn docs:gen
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs