-
Notifications
You must be signed in to change notification settings - Fork 7
89 lines (87 loc) · 3.21 KB
/
test.yaml
File metadata and controls
89 lines (87 loc) · 3.21 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI Test
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.14'
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.25.0
- name: Run golangci-lint
run: golangci-lint run ./...
- name: Verify Codegen
run: ./hack/verify-deepcopy-gen.sh
test:
strategy:
matrix:
kong_version: [ '1.0.3', '1.1.2', '1.2.0', '1.3.0', '1.4.0', '2.0.4', '2.1.0']
env:
KONG_VERSION: ${{ matrix.kong_version }}
KONG_ENTERPRISE_REPO_USERNAME: ${{ secrets.KONG_ENTERPRISE_REPO_USERNAME }}
KONG_ENTERPRISE_REPO_PASSSWORD: ${{ secrets.KONG_ENTERPRISE_REPO_PASSSWORD }}
KONG_LICENSE_DATA: ${{ secrets.KONG_LICENSE_DATA }}
KONG_ANONYMOUS_REPORTS: "off"
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.6-alpine
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.14'
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Postgres
run: |
psql -c 'create database kong;' -U postgres -h 127.0.0.1 -p 5432
psql -c 'create user kong;' -U postgres -h 127.0.0.1 -p 5432
psql -c 'GRANT ALL PRIVILEGES ON DATABASE "kong" to kong;' -U postgres -h 127.0.0.1 -p 5432
- name: Setup Kong
run: bash .ci/setup_kong.sh
- name: Run tests
run: go test -v ./...
test-enterprise:
strategy:
matrix:
kong_version: ['enterprise-1.3.0.2', 'enterprise-1.5.0.2']
env:
KONG_VERSION: ${{ matrix.kong_version }}
KONG_ENTERPRISE_REPO_USERNAME: ${{ secrets.KONG_ENTERPRISE_REPO_USERNAME }}
KONG_ENTERPRISE_REPO_PASSSWORD: ${{ secrets.KONG_ENTERPRISE_REPO_PASSSWORD }}
KONG_LICENSE_DATA: ${{ secrets.KONG_LICENSE_DATA }}
KONG_ANONYMOUS_REPORTS: "off"
KONG_ADMIN_TOKEN: kong
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11.6-alpine
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '^1.14'
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Postgres
run: |
psql -c 'create database kong;' -U postgres -h 127.0.0.1 -p 5432
psql -c 'create user kong;' -U postgres -h 127.0.0.1 -p 5432
psql -c 'GRANT ALL PRIVILEGES ON DATABASE "kong" to kong;' -U postgres -h 127.0.0.1 -p 5432
- name: Setup Kong
run: bash .ci/setup_kong.sh
- name: Run tests
run: go test -tags=enterprise -v ./...