generated from yandex-praktikum/go-musthave-diploma-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.78 KB
/
gophermart.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
name: gophermart
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- master
jobs:
build:
runs-on: ubuntu-latest
container: golang:1.19
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: praktikum
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download autotests binaries
uses: robinraju/[email protected]
with:
repository: Yandex-Practicum/go-autotests-bin
latest: true
fileName: "*"
out-file-path: .tools
- name: Setup autotest binary
run: |
chmod -R +x $GITHUB_WORKSPACE/.tools
mv $GITHUB_WORKSPACE/.tools/gophermarttest /usr/local/bin/gophermarttest
mv $GITHUB_WORKSPACE/.tools/random /usr/local/bin/random
- name: Prepare binaries
run: |
(cd cmd/gophermart && go build -buildvcs=false -o gophermart)
(cd cmd/accrual && chmod +x accrual_linux_amd64)
- name: Test
run: |
gophermarttest \
-test.v -test.run=^TestGophermart$ \
-gophermart-binary-path=cmd/gophermart/gophermart \
-gophermart-host=localhost \
-gophermart-port=8080 \
-gophermart-database-uri="postgresql://postgres:postgres@postgres/praktikum?sslmode=disable" \
-accrual-binary-path=cmd/accrual/accrual_linux_amd64 \
-accrual-host=localhost \
-accrual-port=$(random unused-port) \
-accrual-database-uri="postgresql://postgres:postgres@postgres/praktikum?sslmode=disable"