Skip to content

😊(release): 0.0.2 #103

😊(release): 0.0.2

😊(release): 0.0.2 #103

Workflow file for this run

name: Go-Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: Allow write access to checks to allow the action to annotate code in the PR.
checks: write
jobs:
build-and-test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Check Out Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
cache: false
- name: Create test database
run: |
PGPASSWORD=postgres psql -h localhost -U postgres -c "CREATE DATABASE test_db;"
- name: Build
run: go build -v ./...
- name: Test
run: go test -p 1 -v ./...
env:
TEST_DB_HOST: localhost
TEST_DB_PORT: 5432
TEST_DB_USER: postgres
TEST_DB_PASSWORD: postgres
TEST_DB_NAME: test_db