Skip to content

Build

Build #2

Workflow file for this run

name: CI
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
jobs:
test:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: dnote_test
POSTGRES_PORT: 5432
# Wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
# Expose port to the host
ports:
- 5432:5432
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: '>=1.23.0'
- name: Build
run: go build
- name: Test
run: go test -v
env:
TEST_PG_HOST: localhost
TEST_PG_PORT: 5432
TEST_PG_USER: postgres
TEST_PG_PASSWORD: postgres
TEST_PG_DB: dnote_test