diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 35bced8..5a772bc 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -10,6 +10,9 @@ on: jobs: build: runs-on: ubuntu-latest + env: + GOOSE_DRIVER: postgres + GOOSE_DBSTRING: "user=feedvault password=feedvault dbname=feedvault sslmode=disable" services: postgres: @@ -18,6 +21,7 @@ jobs: POSTGRES_USER: feedvault POSTGRES_PASSWORD: feedvault POSTGRES_DB: feedvault + ports: - 5432:5432 options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 @@ -31,6 +35,23 @@ jobs: check-latest: true go-version: stable + - name: Cache Go modules + uses: actions/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Install Goose + run: go install github.com/pressly/goose/v3/cmd/goose@latest + + - name: Goose Status + run: goose -dir sql/schema status + + - name: Goose Up (Migrate Database) + run: goose -dir sql/schema up + - name: Test run: go test ./... -v diff --git a/.vscode/settings.json b/.vscode/settings.json index c4fe476..a4d8954 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,6 +15,8 @@ "chartboost", "congstar", "datetime", + "dbname", + "DBSTRING", "easybox", "Eo's", "etxr", @@ -54,6 +56,7 @@ "pgtype", "PGUSER", "Prés", + "pressly", "psql", "Rawr", "regexes",