-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.16 KB
/
makefile.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
41
42
43
44
45
46
47
48
49
name: Makefile CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.21.x' ]
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: install gomigrate.
run: |
curl -L https://packagecloud.io/golang-migrate/migrate/gpgkey | sudo apt-key add -
echo "deb https://packagecloud.io/golang-migrate/migrate/ubuntu/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/migrate.list
sudo apt-get update
sudo apt-get install -y migrate
- name: setup postgres
uses: ikalnytskyi/action-setup-postgres@v4
with:
username: root
password: secret
database: simple_bank
port: 5432
id: postgres
- name: initdb tables
run: |
unset PGSERVICEFILE
make migrateup
- name: Run tests
run: make gotest
- name: Run build
run: make gobuild