Skip to content

Commit

Permalink
Update go.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
LuisMarchio03 authored Apr 26, 2024
1 parent f70fdb8 commit 005914b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
Expand All @@ -21,8 +18,19 @@ jobs:
with:
go-version: '1.22.2'

- name: Start MySQL Docker container
run: |
docker run -d --name mysql-db -p 3308:3306 -e MYSQL_ROOT_PASSWORD=my-secret-pw mysql:latest
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
run: |
# Aguarde alguns segundos para garantir que o MySQL esteja pronto
sleep 10
# Execute os testes conectando ao banco de dados MySQL
go test -v ./...
- name: Stop MySQL Docker container
run: docker stop mysql-db

0 comments on commit 005914b

Please sign in to comment.