Merge pull request #2 from AoTTG-2/1-workshop-service #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: PR Tests | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:alpine | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: 12345 | |
POSTGRES_DB: test_workshop | |
options: >- | |
--health-cmd "pg_isready -d postgres -U postgres" | |
--health-interval 2s | |
--health-timeout 60s | |
--health-retries 15 | |
--health-start-period 80s | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: ^1.23.4 | |
id: go | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Test Repository | |
env: | |
TEST_POSTGRES_CONN_STRING: postgres://postgres:12345@localhost:5432/test_workshop?sslmode=disable | |
# Local run with `act` | |
# TEST_POSTGRES_MIGRATIONS_PATH: /mnt/c/Users/Jagerente/Documents/GitHub/workshop-service/migrations/postgres | |
TEST_POSTGRES_MIGRATIONS_PATH: ${{ github.workspace }}/migrations/postgres | |
run: go test -v ./internal/repository/driver/postgres |