-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 1.41 KB
/
test.yml
File metadata and controls
57 lines (54 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: test
on:
workflow_call:
push:
branches:
- "*"
- "!main"
env:
PSQLQUEUE_TEST_DATABASE_URL: "postgres://psqlqueue:psqlqueue@127.0.0.1:5432/psqlqueue-test?sslmode=disable"
PSQLQUEUE_TESTING: "true"
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_DB: psqlqueue-test
POSTGRES_USER: psqlqueue
POSTGRES_PASSWORD: psqlqueue
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Set up Go 1.23
uses: actions/setup-go@v5
with:
go-version: "1.23"
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Get dependencies
run: go mod download
- name: Create default dotenv for testing
run: cp env.sample .env
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: Run Database Migration
run: make run-migration
- name: Run Tests
run: make test