Skip to content

Commit

Permalink
add test workflow for go
Browse files Browse the repository at this point in the history
  • Loading branch information
karngyan committed Dec 23, 2024
1 parent edd919f commit bcb0017
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Go Test

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17.2
ports:
- 5433:5432
env:
POSTGRES_DB: maek_test
POSTGRES_USER: maek
POSTGRES_PASSWORD: passwd
options: >-
--health-cmd="pg_isready -U maek"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
CONFIG_FILE: ${{ github.workspace }}/config/config.toml
CGO_ENABLED: '0'

steps:
- name: Check out code
uses: actions/checkout@v4

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

- name: Install dependencies
run: go mod tidy

- name: Run tests
run: go test -v ./...

0 comments on commit bcb0017

Please sign in to comment.