Skip to content

Commit

Permalink
ci: test
Browse files Browse the repository at this point in the history
  • Loading branch information
labasubagia committed Sep 8, 2023
1 parent d8f3269 commit 0559ccf
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: test
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
name: Test
runs-on: ubuntu-latest

services:
postgres:
image: postgres:alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: realworld
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
check-latest: true

- name: Check out code
uses: actions/checkout@v3

- name: Test
run: make test
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ migrate_drop:

# make new_migration -name=add_new_table
new_migration:
migrate create -ext sql -dir db/migration -seq $(name)
migrate create -ext sql -dir db/migration -seq $(name)

test:
go test -cover ./...

0 comments on commit 0559ccf

Please sign in to comment.