Skip to content

Build and Test GH action #7

Build and Test GH action

Build and Test GH action #7

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
services:
database:
image: timescale/timescaledb:latest-pg14
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: tsdb
options: >-
--health-cmd "pg_isready -d tsdb -U username"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build
run: go build -v ./...
- name: Test
run: SEM_AVOID_DOT_ENV=true SEM_DB_NAME=tsdb SEM_DB_HOST=localhost SEM_DB_PORT=5432 SEM_DB_USER=username SEM_DB_PASSWORD=password go test -v ./...