Skip to content

Added test workflow

Added test workflow #3

Workflow file for this run

name: Go
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.18', '1.19', '1.20', '1.21.x' ]
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: devel
POSTGRES_PASSWORD: devel
POSTGRES_DB: grade
ports:
- 5432:5432 # exposing 5432 port for application to use
# needed because the postgres container does not provide a healthcheck
options: >-
--health-cmd pg_isready --health-interval 10s
--health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Test
run: go test -v ./...
env:
DATABASE_URL: postgres://devel:devel@postgres:5432/grade