Skip to content

Add AWS RDS and update the unit test. #9

Add AWS RDS and update the unit test.

Add AWS RDS and update the unit test. #9

Workflow file for this run

name: Run unit tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15.7-alpine3.19
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test_db
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.22
id: go
- name: Install golang-migrate
run: |
curl -L https://github.com/golang-migrate/migrate/releases/download/v4.14.1/migrate.linux-amd64.tar.gz | tar xvz
sudo mv migrate.linux-amd64 /usr/bin/migrate
which migrate
- name: Set up environment
run: |
cp ./app.env.example ./app.env
cp ./internal/config/env.go.example ./internal/config/env.go
- name: Set up SSL certificate
run: |
mkdir -p internal/config/certs
echo "${{ secrets.RDS_CA_CERT }}" > internal/config/certs/rds-ca-2019-root.pem
- name: Run tests
env:
RDS_CA_CERT: ${{ secrets.RDS_CA_CERT }}
run: make go-test-ci