forked from kelseyhightower/confd
-
-
Notifications
You must be signed in to change notification settings - Fork 12
158 lines (143 loc) · 4.52 KB
/
integration-tests.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Integration Tests
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0' # weekly
jobs:
# Label of the container job
container-job:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: ubuntu:22.04
# Service containers to run with `container-job`
services:
# Label used to access the service container
consul:
image: hashicorp/consul
ports:
- 8500:8500
etcd:
image: quay.io/coreos/etcd:v3.5.13
ports:
- 2379:2379
env:
ETCD_LISTEN_CLIENT_URLS: http://0.0.0.0:2379
ETCD_ADVERTISE_CLIENT_URLS: http://0.0.0.0:2379
localstack:
image: localstack/localstack
ports:
- 4566:4566
env:
SERVICES: dynamodb,ssm
redis:
image: redis
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
vault:
image: hashicorp/vault
ports:
- 8200:8200
env:
VAULT_DEV_ROOT_TOKEN_ID: "super-secret-token"
zookeeper:
image: zookeeper
ports:
- 2181:2181
env:
ZOO_STANDALONE_ENABLED: true
steps:
- name: Install dependencies
run: |
apt-get -q update
DEBIAN_FRONTEND="noninteractive" apt-get install -y git curl make redis-tools sudo awscli gnupg2 lsb-release etcd-client
echo "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main" >> /etc/apt/sources.list
curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add -
apt-get -q update
DEBIAN_FRONTEND="noninteractive" apt-get install -y vault
# Downloads a copy of the code in your repository before running CI tests
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.6
- name: Build and Install
run: |
git config --global --add safe.directory /__w/confd/confd
make build
sudo make install
- name: Test Env
run: |
test/integration/env/test.sh
test/integration/expect/check.sh
- name: Test File
run: |
test/integration/file/test_yaml.sh
test/integration/expect/check.sh
test/integration/file/test_json.sh
test/integration/expect/check.sh
- name: Test Consul
run: |
test/integration/consul/test.sh
test/integration/expect/check.sh
env:
CONSUL_HOST: consul
CONSUL_PORT: 8500
- name: Test etcd
run: |
test/integration/etcd/test.sh
test/integration/expect/check.sh
env:
ETCD_ENDPOINT: "http://etcd:2379"
- name: Test DynamoDB
run: |
test/integration/dynamodb/test.sh
test/integration/expect/check.sh
env:
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test"
AWS_REGION: "us-east-1"
AWS_DEFAULT_REGION: "us-east-1"
DYNAMODB_LOCAL: 1
DYNAMODB_ENDPOINT_URL: http://localstack:4566
- name: Test Redis
run: |
test/integration/redis/test.sh
test/integration/expect/check.sh
env:
REDIS_HOST: redis
REDIS_PORT: 6379
- name: Test SSM Parameter Store
run: |
test/integration/ssm/test.sh
test/integration/expect/check.sh
env:
AWS_ACCESS_KEY_ID: "test"
AWS_SECRET_ACCESS_KEY: "test"
AWS_REGION: "us-east-1"
AWS_DEFAULT_REGION: "us-east-1"
SSM_LOCAL: "1"
SSM_ENDPOINT_URL: "http://localstack:4566"
- name: Test Vault
run: |
test/integration/vault-v1/test.sh
test/integration/expect/check.sh
test/integration/vault-v2/test.sh
test/integration/expect/check.sh
test/integration/vault-approle/test.sh
test/integration/expect/check.sh
env:
VAULT_ADDR: http://vault:8200
VAULT_TOKEN: "super-secret-token"
- name: Test Zookeeper
run: |
test/integration/zookeeper/test.sh
test/integration/expect/check.sh
env:
ZOOKEEPER_NODE: zookeeper