Skip to content

Add build and test workflows #1

Add build and test workflows

Add build and test workflows #1

Workflow file for this run

name: Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21.3'
- name: Start PostgreSQL
run: |
docker run -d \
--name postgres \
-e POSTGRES_DB=formify_test \
-e POSTGRES_USER=gh_action_user \
-e POSTGRES_PASSWORD=gh_action_user_password \
-p 5432:5432 \
postgres
- name: Run tests
env:
TEST_DB_HOST: localhost
TEST_DB_PORT: 5432
TEST_DB_NAME: formify_test
TEST_DB_USER: gh_action_user
TEST_DB_PASSWORD: gh_action_user_password
run: go test -v ./tests/...