From eae97a482933f734964e82e7936fe578e2daa2ba Mon Sep 17 00:00:00 2001 From: Prapti Sharma Date: Sat, 1 Jun 2024 13:17:52 +0530 Subject: [PATCH] [fix] Workflow and test updated #274 Fixes #274 --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 07a3be73..ee38dca3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,23 @@ jobs: image: redis ports: - 6379:6379 + influxdb: + image: influxdb:1.8-alpine + ports: + - 8086:8086 + influxdb2: + image: influxdb:2.0-alpine + volumes: + - influxdb2-data:/var/lib/influxdb2 + ports: + - 8087:8086 + options: >- + --env DOCKER_INFLUXDB_INIT_MODE=setup + --env DOCKER_INFLUXDB_INIT_USERNAME=openwisp + --env DOCKER_INFLUXDB_INIT_PASSWORD=openwisp + --env DOCKER_INFLUXDB_INIT_ORG=openwisp + --env DOCKER_INFLUXDB_INIT_BUCKET=openwisp2 + --env DOCKER_INFLUXDB_INIT_RETENTION=1w strategy: fail-fast: false @@ -33,6 +50,9 @@ jobs: - django~=3.2.0 - django~=4.1.0 - django~=4.2.0 + influxdb-version: + - influxdb + - influxdb2 steps: - name: Install system packages @@ -64,8 +84,8 @@ jobs: - name: Install npm dependencies run: sudo npm install -g jshint stylelint - - name: Start InfluxDB container - run: docker-compose up -d influxdb + - name: Start InfluxDB ${{ matrix.influxdb-version }} container + run: docker-compose up -d ${{ matrix.influxdb-version }} - name: Install test dependencies run: | @@ -77,6 +97,13 @@ jobs: pip uninstall -y django pip install ${{ matrix.django-version }} + - name: Set InfluxDB environment variables for InfluxDB 2.x + if: matrix.influxdb-version == 'influxdb2' + run: | + export INFLUXDB_HOST=localhost + export INFLUXDB_PORT=8087 + export USE_INFLUXDB2=True + - name: QA checks run: | ./run-qa-checks