-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (36 loc) · 1.17 KB
/
test.yml
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
name: test
on:
- push
- pull_request
jobs:
test:
strategy:
matrix:
go-version:
- 1.20.x
os: [ubuntu-latest]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Start Postgresql
run: |
sudo systemctl start postgresql.service
pg_isready
sudo -u postgres createuser -s -d -r -w runner
# See: https://dev.to/lxxxvi/github-action-using-pre-installed-postgres-5144
- name: Setup Postgres
run: |
psql postgres -c 'CREATE DATABASE oui;'
psql postgres -c "CREATE USER oui WITH PASSWORD 'oui';"
psql postgres -c 'ALTER DATABASE oui OWNER TO oui;'
- name: Go Setup
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Run Tests
run: go test -v ./...
env:
POSTGRES_PASSWORD: oui