Skip to content

Commit

Permalink
feat: add Github Action to build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ace committed Aug 13, 2023
1 parent 42a8e46 commit a074784
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: deploy

on:
push:
branches: [ "main", "dev" ]
pull_request:
branches: [ "main", "dev" ]

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15.4-alpine
env:
POSTGRES_PASSWORD: password
POSTGRES_USER: root
POSTGRES_DB: volta
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Run migrations
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.16.2/migrate.linux-amd64.tar.gz | tar xvz
sudo mv migrate /usr/bin/
make migrateup
- name: Build
run: go build -v ./...

- name: Test
run: make test

0 comments on commit a074784

Please sign in to comment.