13
13
jobs :
14
14
build :
15
15
runs-on : ubuntu-latest
16
- container : registry.gitlab.com/dealmore/dealmore- build-images/lambda: nodejs14.x
16
+ container : public.ecr.aws/sam/ build-nodejs14.x:latest
17
17
18
18
steps :
19
+ - name : Install yarn
20
+ run :
npm install --global [email protected]
21
+
19
22
- uses : actions/checkout@v2
20
23
21
24
- name : Cache
@@ -37,31 +40,48 @@ jobs:
37
40
with :
38
41
name : dist
39
42
path : |
40
- packages/runtime /dist/
41
- packages/tf-next /dist/
42
- packages/proxy /dist/
43
- packages/proxy /dist.zip
43
+ packages/api /dist/
44
+ packages/api /dist.zip
45
+ packages/deploy-controller /dist/
46
+ packages/deploy-controller /dist.zip
44
47
packages/deploy-trigger/dist/
45
48
packages/deploy-trigger/dist.zip
49
+ packages/proxy/dist/
50
+ packages/proxy/dist.zip
51
+ packages/proxy-config/dist/
52
+ packages/proxy-config/dist.zip
53
+ packages/runtime/dist/
54
+ packages/tf-next/dist/
46
55
if-no-files-found : error
47
56
48
57
test-integration :
49
58
needs : build
50
59
runs-on : ubuntu-latest
51
- container : registry.gitlab.com/dealmore/dealmore- build-images/lambda: nodejs14.x
60
+ container : public.ecr.aws/sam/ build-nodejs14.x:latest
52
61
services :
53
62
s3 :
54
63
image : registry.gitlab.com/dealmore/dealmore-build-images:s3-emulator
55
64
env :
56
65
MINIO_ACCESS_KEY : test
57
66
MINIO_SECRET_KEY : testtest
67
+ dynamodb :
68
+ image : amazon/dynamodb-local:latest
69
+ # @note Github overwrites WORKDIR to repository path, so overwrite that again
70
+ options : >-
71
+ --workdir /home/dynamodblocal
58
72
59
73
env :
74
+ # Increase heap size for running the tests
75
+ NODE_OPTIONS : ' --max_old_space_size=4096'
60
76
MINIO_ACCESS_KEY : test
61
77
MINIO_SECRET_KEY : testtest
62
78
S3_ENDPOINT : s3:9000
79
+ TEST_DYNAMO_ENDPOINT : http://dynamodb:8000
63
80
64
81
steps :
82
+ - name : Install yarn
83
+ run :
npm install --global [email protected]
84
+
65
85
- uses : actions/checkout@v2
66
86
67
87
- name : Cache
72
92
**/node_modules
73
93
key : ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
74
94
75
- - name : Yarn install
95
+ - name : Install dependencies
76
96
run : yarn --frozen-lockfile --cache-folder .yarn
77
97
78
98
- name : Download build artifacts
@@ -82,13 +102,19 @@ jobs:
82
102
path : packages
83
103
84
104
- name : Jest
85
- run : yarn test
105
+ run : yarn test:not:runtime
86
106
87
- test-e2e-prepare :
107
+ # We run the runtime tests in a dedicated task since running it with the
108
+ # other integration tests would cause a memory overflow.
109
+ test-integration-runtime :
88
110
needs : build
89
111
runs-on : ubuntu-latest
90
- container : registry.gitlab.com/dealmore/dealmore-build-images/lambda:nodejs14.x
112
+ container : public.ecr.aws/sam/build-nodejs14.x:latest
113
+
91
114
steps :
115
+ - name : Install yarn
116
+ run :
npm install --global [email protected]
117
+
92
118
- uses : actions/checkout@v2
93
119
94
120
- name : Cache
99
125
**/node_modules
100
126
key : ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
101
127
102
- - name : Yarn install
128
+ - name : Install dependencies
103
129
run : yarn --frozen-lockfile --cache-folder .yarn
104
130
105
131
- name : Download build artifacts
@@ -108,41 +134,16 @@ jobs:
108
134
name : dist
109
135
path : packages
110
136
111
- - name : Build e2e fixtures
112
- run : yarn test:e2e:prepare
113
-
114
- - name : Upload e2e fixtures
115
- uses : actions/upload-artifact@v2
116
- with :
117
- name : e2e-fixtures
118
- path : test/fixtures/**/.next-tf/**/*
119
- if-no-files-found : error
137
+ - name : Jest
138
+ run : yarn test:runtime
120
139
121
- test-e2e :
122
- needs : [ build, test-e2e-prepare]
140
+ test-e2e-prepare :
141
+ needs : build
123
142
runs-on : ubuntu-latest
124
- services :
125
- s3 :
126
- image : registry.gitlab.com/dealmore/dealmore-build-images:s3-emulator
127
- env :
128
- MINIO_ACCESS_KEY : test
129
- MINIO_SECRET_KEY : testtest
130
- ports :
131
- - 9000:9000
132
- env :
133
- SAM_CLI_TELEMETRY : 0
134
- # Don't worry these are fake AWS credentials for AWS SAM
135
- AWS_ACCESS_KEY_ID : ABIAZLJNBT8I3KFOU4NO
136
- AWS_SECRET_ACCESS_KEY : 4Xt3Rbx4DO21MhK1IHXZXRvVRDuqaQ0Wo5lILA/h
137
- MINIO_ACCESS_KEY : test
138
- MINIO_SECRET_KEY : testtest
139
-
143
+ container : public.ecr.aws/sam/build-nodejs14.x:latest
140
144
steps :
141
- - name : Setup AWS SAM
142
- run : |
143
- brew tap aws/tap
144
- brew install aws-sam-cli
145
- sam --version
145
+ - name : Install yarn
146
+ run :
npm install --global [email protected]
146
147
147
148
- uses : actions/checkout@v2
148
149
@@ -152,37 +153,31 @@ jobs:
152
153
path : |
153
154
.yarn
154
155
**/node_modules
155
- key : ${{ runner.os }}-e2e-${{ hashFiles('yarn.lock') }}
156
+ key : ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
157
+
158
+ - name : Yarn install
159
+ run : yarn --frozen-lockfile --cache-folder .yarn
156
160
157
161
- name : Download build artifacts
158
162
uses : actions/download-artifact@v2
159
163
with :
160
164
name : dist
161
165
path : packages
162
166
163
- - name : Download prebuilt e2e fixtures
164
- uses : actions/download-artifact@v2
167
+ - name : Build e2e fixtures
168
+ run : yarn test:e2e:prepare
169
+
170
+ - name : Upload e2e fixtures
171
+ uses : actions/upload-artifact@v2
165
172
with :
166
173
name : e2e-fixtures
167
- path : test/fixtures
168
-
169
- - name : Install dependencies
170
- run : yarn --frozen-lockfile --cache-folder .yarn
171
-
172
- - name : Run e2e-test
173
- run : yarn test:e2e --runInBand
174
-
175
- - name : Output SAM logs
176
- run : |
177
- printf "\n\nOutput of sam-local.log:\n"
178
- cat sam-local.log
179
- printf "\n\nOutput of sam-api.log:\n"
180
- cat sam-api.log
174
+ path : test/fixtures/**/.next-tf/**/*
175
+ if-no-files-found : error
181
176
182
177
publishRelease :
183
178
name : Potentially publish release
184
179
runs-on : ubuntu-latest
185
- needs : [build, test-integration, test-e2e ]
180
+ needs : [build, test-integration, test-integration-runtime ]
186
181
if : github.ref == 'refs/heads/main'
187
182
env :
188
183
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments