-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (61 loc) · 2 KB
/
flow.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: openbanking-paymentinitiation-ci
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
go-version: [1.15.x]
os: [ ubuntu-latest ] #[ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
services:
postgres:
image: postgres:11
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: paymentinitiation
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Check cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
env:
MIGRATE_TEST_SCRIPT_URL: file://scripts/postgresql
MIGRATE_TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/paymentinitiation?sslmode=disable
MIGRATE_VERSION: "2"
DRIVER_NAME: postgres
DATASOURCE_URL: postgres://postgres:postgres@localhost:5432/paymentinitiation?sslmode=disable
run: |
go run ./cmd/migrate
ls -lt ./testdata/
go test -v ./...
- name: Build
run: |
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o payment ./cmd/payment
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o callback ./cmd/callback
ls -lt
- name: Build and push Docker images
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_ID }}
password: ${{ secrets.DOCKER_PASSWORD }}
path: .
repository: kaktas/openbanking-paymentinitiation
tags: latest