-
Notifications
You must be signed in to change notification settings - Fork 20
103 lines (89 loc) · 3.59 KB
/
main.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This is a basic workflow to help you get started with Actions
name: haproxy-consul-connect
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Runs a single command using the runners shell
- name: Linting checks
run: make check
# failing so disabled for now
# golangci:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v2
# with:
# # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
# version: latest
# # Optional: golangci-lint command line arguments.
# args: --timeout 600s
build:
name: build and run e2e for master vs Consul
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
consul_version: ["1.9.3"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build check
run: make bin
- name: e2e Consul test
run: |
cp haproxy-connect test/integration/connect/haproxy/
cd test/integration/connect/haproxy/
docker rmi -f consul-dev
docker pull consul:${{ matrix.consul_version }}
docker tag consul:${{ matrix.consul_version }} consul-dev
docker build -f Dockerfile-consul-haproxy-consul-connect . -t haproxytech/haproxy-consul-connect:master --build-arg "HAPROXY_CONSUL_CONNECT_VERSION=0.9.0"
HAPROXY_CONSUL_CONNECT_VERSION=master go test -tags integration "$@"
env:
TERM: linux
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: setup environment
run: |
sudo curl -sfSL https://github.com/haproxytech/dataplaneapi/releases/download/v2.1.0/dataplaneapi_2.1.0_Linux_x86_64.tar.gz -o dataplane.tar.gz
sudo mkdir /tmp/dataplane
sudo tar -xzf dataplane.tar.gz -C /tmp/dataplane --strip-components=1
sudo mv /tmp/dataplane/dataplaneapi /usr/local/bin/dataplaneapi
sudo chmod +x /usr/local/bin/dataplaneapi
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:vbernat/haproxy-2.1
sudo apt-get update
sudo apt-get install -y haproxy=2.1.\*
haproxy -vv
- name: go tests
run: HAPROXY=/usr/sbin/haproxy DATAPLANEAPI=/usr/local/bin/dataplaneapi go test -timeout 600s ./...