Skip to content

Merge pull request #646 from dataplane-app/improve-folders #779

Merge pull request #646 from dataplane-app/improve-folders

Merge pull request #646 from dataplane-app/improve-folders #779

Workflow file for this run

name: CI-main-dataplane
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: timescale/timescaledb:latest-pg15
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: "Hello123!"
POSTGRES_DB: "dataplane"
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis-service:
image: redis:7.2-alpine
ports:
- 6379:6379
nats:
image: nats:2.9-scratch
ports:
- 4222:4222
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: 1.21
# Get values for cache paths to be used in later steps
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Checkout code
uses: actions/checkout@v2
# Cache go build cache, used to speedup go test
- name: Go Build Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-build }}
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
# Cache go mod cache, used to speedup builds
- name: Go Mod Cache
uses: actions/cache@v2
with:
path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Create file directory
run: echo ${{ github.workspace }}/appdev/code-files/ && mkdir -p ${{ github.workspace }}/appdev/code-files/
- name: Run Go Tests
env:
DP_DB_HOST: localhost
DP_DB_USER: postgres
DP_DB_SSL: "disable"
DP_DB_PORT: "5432"
DP_DB_DATABASE: "dataplane"
secret_db_pwd: "Hello123!"
DP_DATABASE: "timescaledb"
DP_MODE: "development"
DP_DEBUG: "true"
DP_DB_DEBUG: "false"
DP_MQ_DEBUG: "true"
DP_METRIC_DEBUG: "false"
DP_SCHEDULER_DEBUG: "true"
DP_WORKER_HEARTBEAT_SECONDS: "1"
DP_WORKER_GROUP: "python_1"
DP_WORKER_CMD: "/bin/bash"
DP_WORKER_TYPE: "vm"
DP_WORKER_LB: "roundrobin"
DP_WORKER_ENV: "Development"
DP_CLEANTASKS_DAYS: "60"
DP_REMOVELOGS_DAYS: "60"
DP_CODE_FOLDER: "${{ github.workspace }}/appdev/code-files/"
DP_CODE_FILE_STORAGE: "Database"
DP_DFS_CODE_FOLDER: "${{ github.workspace }}/appdev/dfs-code-files/"
DP_REDIS_HOST: "localhost"
DP_REDIS_PORT: "6379"
DP_REDIS_PASSWORD: ""
DP_REDIS_DB: "0"
run: cd app/mainapp && time go run Tests/mainTest.go