Skip to content

fix: update migration file #4

fix: update migration file

fix: update migration file #4

Workflow file for this run

name: "api: test"
on:
push:
branches-ignore:
- "master"
paths:
- "api/**"
workflow_dispatch:
jobs:
core-build:
runs-on: ubuntu-latest
timeout-minutes: 3
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: orakl-test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 6379:6379
steps:
- uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: "1.21.5"
check-latest: true
cache-dependency-path: |
./api/go.sum
- name: Install golang-migrate
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.17.0/migrate.linux-amd64.tar.gz | tar xvz
sudo mv ./migrate /usr/bin
- name: Migrate up
run: |
cd ./api
migrate -database "postgresql://postgres:postgres@localhost:5432/orakl-test?search_path=public&sslmode=disable" -verbose -path ./migrations up
- name: Install dependencies
run: |
cd ./api
go mod tidy
- name: Build
run: |
cd ./api
go build
- name: Run test
run: |
cd ./api
go test ./tests -v
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/orakl-test?search_path=public"
ENCRYPT_PASSWORD: "abc123"
REDIS_HOST: "localhost"
REDIS_PORT: "6379"
TEST_MODE: true