Bump GitHub InfluxDB v2.7.x release #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.2' | |
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 |