@@ -116,6 +116,59 @@ jobs:
116
116
with :
117
117
name : scraper_lambda
118
118
path : ./scraper/scraper_lambda.zip
119
+
120
+ test-and-build-api-users :
121
+ name : Test and Build API Users
122
+ runs-on : ubuntu-latest
123
+ steps :
124
+ - name : Checkout code
125
+ uses : actions/checkout@v4
126
+
127
+ - name : Set up Go
128
+ uses : actions/setup-go@v2
129
+ with :
130
+ go-version : ' 1.22.4'
131
+
132
+ - name : Cache dependencies
133
+ uses : actions/cache@v2
134
+ with :
135
+ path : ~/go/pkg/mod
136
+ key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
137
+ restore-keys : |
138
+ ${{ runner.os }}-go-
139
+
140
+ - name : Install dependencies
141
+ working-directory : ./api-users
142
+ run : go mod download
143
+
144
+ - name : Run golangci-lint
145
+ uses : golangci/golangci-lint-action@v6.0.1
146
+ with :
147
+ working-directory : .
148
+ args : --out-format colored-line-number ./api-users/...
149
+
150
+ - name : Run tests
151
+ working-directory : ./api-users
152
+ run : go test -coverprofile=coverage.out ./...
153
+
154
+ - name : Upload coverage to codecov
155
+ uses : codecov/codecov-action@v2
156
+ with :
157
+ token : ${{ secrets.CODECOV_TOKEN }}
158
+
159
+ - name : Build API Users binary
160
+ working-directory : ./api-users
161
+ run : GOOS=linux GOARCH=amd64 go build -o bootstrap main.go
162
+
163
+ - name : Zip API Users binary
164
+ working-directory : ./api-users
165
+ run : zip api_users_lambda.zip bootstrap
166
+
167
+ - name : Upload API Users artifact
168
+ uses : actions/upload-artifact@v2
169
+ with :
170
+ name : api_users_lambda
171
+ path : ./api-users/api_users_lambda.zip
119
172
120
173
deploy :
121
174
name : Deploy
@@ -137,6 +190,12 @@ jobs:
137
190
name : scraper_lambda
138
191
path : ./terraform
139
192
193
+ - name : Download API Users artifact
194
+ uses : actions/download-artifact@v2
195
+ with :
196
+ name : api_users_lambda
197
+ path : ./terraform
198
+
140
199
- name : Set up Terraform
141
200
uses : hashicorp/setup-terraform@v1
142
201
0 commit comments