12
12
jobs :
13
13
# Installs npm dependencies for the first time,
14
14
# caching them in ~/.npm
15
- install :
16
- runs-on : ubuntu-latest
17
- steps :
18
- - uses : actions/checkout@v3
19
- - uses : actions/setup-node@v3
20
- with :
21
- node-version : 18
22
- # This only caches ~/.npm, therefore each subsequent
23
- # job needs to run `npm ci` to install deps from npm cache
24
- # alternative is to cache `node_modules` directly
25
- # TODO:
26
- # https://www.voorhoede.nl/en/blog/super-fast-npm-install-on-github-actions/
27
- # Add caching of `node_modules` to speed up this workflow
28
- cache : npm
15
+ # install:
16
+ # runs-on: ubuntu-latest
17
+ # steps:
18
+ # - uses: actions/checkout@v3
19
+ # - uses: actions/setup-node@v3
20
+ # with:
21
+ # node-version: 18
22
+ # # This only caches ~/.npm, therefore each subsequent
23
+ # # job needs to run `npm ci` to install deps from npm cache
24
+ # # alternative is to cache `node_modules` directly
25
+ # # TODO:
26
+ # # https://www.voorhoede.nl/en/blog/super-fast-npm-install-on-github-actions/
27
+ # # Add caching of `node_modules` to speed up this workflow
28
+ # cache: npm
29
+ #
30
+ # # install dependencies from the package-lock.json
31
+ # - name: Install dependencies
32
+ # run: npm ci --workspaces
33
+ #
34
+ # # builds all packages
35
+ # build:
36
+ # runs-on: ubuntu-latest
37
+ # needs: install
38
+ # steps:
39
+ # - uses: actions/checkout@v3
40
+ # - uses: actions/setup-node@v3
41
+ # with:
42
+ # node-version: 18
43
+ # cache: npm
44
+ #
45
+ # - name: "Install dependencies"
46
+ # run: npm ci --workspaces --include-workspace-root
47
+ #
48
+ # - name: "Build"
49
+ # run: npm run build
50
+ #
51
+ # # lints all packages
52
+ # lint:
53
+ # runs-on: ubuntu-latest
54
+ # needs: install
55
+ # steps:
56
+ # # check out the repository
57
+ # - uses: actions/checkout@v3
58
+ # - uses: actions/setup-node@v3
59
+ # with:
60
+ # node-version: 18
61
+ # cache: npm
62
+ #
63
+ # - name: "Install dependencies"
64
+ # run: npm ci --workspaces --include-workspace-root
65
+ #
66
+ # - name: "Build"
67
+ # run: npm run build
68
+ #
69
+ # - name: "Lint"
70
+ # run: npm run lint
71
+ #
72
+ # - name: "Check formatting"
73
+ # run: npx prettier ./packages --check
74
+ #
75
+ # # tests all packages
76
+ # test:
77
+ # runs-on: ubuntu-latest
78
+ # needs: install
79
+ # steps:
80
+ # - uses: actions/checkout@v3
81
+ # - uses: actions/setup-node@v3
82
+ # with:
83
+ # node-version: 18
84
+ # cache: npm
85
+ #
86
+ # - name: "Install dependencies"
87
+ # run: npm ci --workspaces --include-workspace-root
88
+ #
89
+ # - name: "Build"
90
+ # run: npm run build
91
+ #
92
+ # - name: "Test"
93
+ # run: npm run test:ci
29
94
30
- # install dependencies from the package-lock.json
31
- - name : Install dependencies
32
- run : npm ci --workspaces
33
-
34
- # builds all packages
35
- build :
95
+ integration :
36
96
runs-on : ubuntu-latest
37
- needs : install
38
- steps :
39
- - uses : actions/checkout@v3
40
- - uses : actions/setup-node@v3
41
- with :
42
- node-version : 18
43
- cache : npm
97
+ # needs: test
44
98
45
- - name : " Install dependencies"
46
- run : npm ci --workspaces --include-workspace-root
99
+ env :
100
+ POSTGRES_URL : postgres
101
+ REDIS_URL : redis
102
+ DATABASE_URL : " postgresql://admin:password@postgres:5432/protokit?schema=public"
47
103
48
- - name : " Build"
49
- run : npm run build
104
+ services :
105
+ postgres :
106
+ image : postgres:14-alpine
107
+ env :
108
+ POSTGRES_PASSWORD : password
109
+ POSTGRES_USER : admin
110
+ POSTGRES_DB : protokit
111
+ ports :
112
+ - 5432:5432
113
+ redis :
114
+ image : redis:6.2-alpine
115
+ command : redis-server /redis.conf --requirepass password
116
+ ports :
117
+ - 6379:6379
50
118
51
- # lints all packages
52
- lint :
53
- runs-on : ubuntu-latest
54
- needs : install
55
119
steps :
56
- # check out the repository
57
120
- uses : actions/checkout@v3
58
121
- uses : actions/setup-node@v3
59
122
with :
@@ -66,28 +129,8 @@ jobs:
66
129
- name : " Build"
67
130
run : npm run build
68
131
69
- - name : " Lint"
70
- run : npm run lint
71
-
72
- - name : " Check formatting"
73
- run : npx prettier ./packages --check
74
-
75
- # tests all packages
76
- test :
77
- runs-on : ubuntu-latest
78
- needs : install
79
- steps :
80
- - uses : actions/checkout@v3
81
- - uses : actions/setup-node@v3
82
- with :
83
- node-version : 18
84
- cache : npm
85
-
86
- - name : " Install dependencies"
87
- run : npm ci --workspaces --include-workspace-root
88
-
89
- - name : " Build"
90
- run : npm run build
132
+ - name : " Migrate DB"
133
+ run : npm run migrate
91
134
92
- - name : " Test "
93
- run : npm run test:ci
135
+ - name : " Integration tests "
136
+ run : npm run test:integration
0 commit comments