-
Notifications
You must be signed in to change notification settings - Fork 40
138 lines (124 loc) · 4.21 KB
/
test-v2.x.yaml
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
name: Test InfluxDB v2.x
on:
pull_request:
push:
branches:
- master
- test
tags:
- '*'
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- elixir: '1.9.4'
otp: '20.3'
runs-on: ubuntu-20.04
influxdb_image_version: '2.0.9'
influxdb_test_version: '2.0'
- elixir: '1.10.4'
otp: '21.3'
runs-on: ubuntu-20.04
influxdb_image_version: '2.1.1'
influxdb_test_version: '2.1'
- elixir: '1.11.4'
otp: '22.3'
runs-on: ubuntu-20.04
influxdb_image_version: '2.2.0'
influxdb_test_version: '2.2'
- elixir: '1.12.3'
otp: '23.3'
runs-on: ubuntu-20.04
influxdb_image_version: '2.3.0'
influxdb_test_version: '2.3'
- elixir: '1.13.4'
otp: '24.3'
runs-on: ubuntu-22.04
influxdb_image_version: '2.4.0'
influxdb_test_version: '2.4'
- elixir: '1.14.5'
otp: '25.3'
runs-on: ubuntu-22.04
influxdb_image_version: '2.5.1'
influxdb_test_version: '2.5'
- elixir: '1.15.7'
otp: '26.2'
runs-on: ubuntu-22.04
influxdb_image_version: '2.6.1'
influxdb_test_version: '2.6'
- elixir: '1.16.3'
otp: '26.2'
runs-on: ubuntu-22.04
influxdb_image_version: '2.7.6'
influxdb_test_version: '2.7'
services:
influxdb:
image: influxdb:${{ matrix.influxdb_image_version }}
ports:
- 8086:8086
env:
INFLUXDB_HOST: localhost
INFLUXDB_PORT: 8086
INFLUXDB_SCHEME: http
INFLUXDB_VERSION: ${{ matrix.influxdb_test_version }}
INFLUXDB_V2_BUCKET: test_bucket
INFLUXDB_V2_DATABASE: mapped_database
INFLUXDB_V2_ORG: instream_test
INFLUXDB_V2_PASSWORD: instream_test
INFLUXDB_V2_RETENTION: mapped_retention
INFLUXDB_V2_USERNAME: instream_test
steps:
- uses: actions/checkout@v4
- name: setup
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: mix-cache
uses: actions/cache@v4
id: mix-cache
with:
path: deps
# yamllint disable-line rule:line-length
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: mix-deps
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: test
run: |
until curl -s -o /dev/null "http://${INFLUXDB_HOST}:${INFLUXDB_PORT}" 2>/dev/null; do
sleep 1
done
SETUP=$(
curl -s \
-XPOST "http://${INFLUXDB_HOST}:${INFLUXDB_PORT}/api/v2/setup" \
-H 'accept: application/json' \
-d "{
\"username\": \"${INFLUXDB_V2_USERNAME}\",
\"password\": \"${INFLUXDB_V2_PASSWORD}\",
\"org\": \"${INFLUXDB_V2_ORG}\",
\"bucket\": \"${INFLUXDB_V2_BUCKET}\"
}"
)
export INFLUXDB_V2_BUCKETID=$(jq -r '.bucket.id' <<< "${SETUP}")
export INFLUXDB_V2_ORGID=$(jq -r '.org.id' <<< "${SETUP}")
export INFLUXDB_V2_TOKEN=$(jq -r '.auth.token' <<< "${SETUP}")
curl -s -o /dev/null \
-XPOST "http://${INFLUXDB_HOST}:${INFLUXDB_PORT}/api/v2/dbrps" \
-H "Authorization: Token ${INFLUXDB_V2_TOKEN}" \
-H 'accept: application/json' \
-d "{
\"bucketID\": \"${INFLUXDB_V2_BUCKETID}\",
\"database\": \"${INFLUXDB_V2_DATABASE}\",
\"default\": true,
\"orgID\": \"${INFLUXDB_V2_ORGID}\",
\"retention_policy\": \"${INFLUXDB_V2_RETENTION}\"
}"
mix coveralls