Skip to content

Commit

Permalink
feat: add postgres to actions (#3)
Browse files Browse the repository at this point in the history
* feat: add postgres to actions

* fix: remove toolchain

* fix: remove toolchain

* fix: update comment
  • Loading branch information
Mahanmmi authored Dec 6, 2024
1 parent e99804f commit f632cfc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ jobs:
strategy:
matrix:
go-version: [ '1.22.x', '1.21.x', '1.20.x' ]

# Boot up a local, clean postgres instance for the postgres tests
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:13.18
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
# Checks-out your repository under $GITHUB_WORKSPACE
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module github.com/microsoft/durabletask-go

go 1.21

toolchain go1.23.1

require (
github.com/cenkalti/backoff/v4 v4.1.3
github.com/golang/protobuf v1.5.3
Expand Down
3 changes: 2 additions & 1 deletion tests/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package tests
import (
"context"
"fmt"
"github.com/microsoft/durabletask-go/backend/postgres"
"reflect"
"runtime"
"testing"
Expand All @@ -28,7 +29,7 @@ var (
var backends = []backend.Backend{
sqlite.NewSqliteBackend(sqliteFileOptions, logger),
sqlite.NewSqliteBackend(sqliteInMemoryOptions, logger),
//postgres.NewPostgresBackend(nil, logger), // Requires a local Postgres instance running with host=localhost, user=postgres, password=postgres, dbname=postgres
postgres.NewPostgresBackend(nil, logger), // Requires a local Postgres instance running with host=localhost, port=5432, user=postgres, password=postgres, dbname=postgres.
}

var completionStatusValues = []protos.OrchestrationStatus{
Expand Down

0 comments on commit f632cfc

Please sign in to comment.