Run Goose in GitHub workflow
This commit is contained in:
parent
1422c3847c
commit
f3c380ca57
2 changed files with 24 additions and 0 deletions
21
.github/workflows/go.yml
vendored
21
.github/workflows/go.yml
vendored
|
|
@ -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
|
||||
|
||||
|
|
|
|||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue