Skip to content

Commit

Permalink
go workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-burghardt committed May 6, 2024
1 parent 73a113e commit a3870b0
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Go

on:
push:
branches: [main]
pull_request:
branches: ["**"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Build Project
run: go build ./...

test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
PGHOST: localhost
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
PGUSER: postgres
PGPASSWORD: postgres
PGHOST: localhost
PGPORT: 5432
DATABASE_URL: postgres://postgres@localhost:5432/postgres?sslmode=disable
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"

- name: Run Tests
run: go test -v -race -cover ./...

0 comments on commit a3870b0

Please sign in to comment.