Skip to content

Merge pull request #27 from RanchoCooper/feature/improve #110

Merge pull request #27 from RanchoCooper/feature/improve

Merge pull request #27 from RanchoCooper/feature/improve #110

name: CI/CD with Docker for Golang
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
services:
testcontainers:
image: testcontainers/ryuk:0.10.2
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: mysqlroot
MYSQL_DATABASE: go_hexagonal
MYSQL_USER: user
MYSQL_PASSWORD: mysqlroot
postgres:
image: postgres:latest
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123456
POSTGRES_DATABASE: postgres
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.23
- name: Install dependencies
run: go mod tidy
- name: Run Tests
run: go test -v ./...
# - name: Lint Code
# run: |
# go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
# golangci-lint run