Merge branch 'main' of https://github.com/LuisMarchio03/golang_migrat… #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22.2' | |
- name: Start MySQL Docker container | |
run: | | |
docker run -d --name mysql \ | |
-p 3308:3306 \ | |
-e MYSQL_ROOT_PASSWORD=root \ | |
-e MYSQL_DATABASE=meu_app_db \ | |
-e MYSQL_USER=meu_app_user \ | |
-e MYSQL_PASSWORD=meu_app_password \ | |
mysql:latest | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
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 | |
create_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Configurar Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: '1.22.2' | |
- name: Criar Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v1.0.0 | |
release_name: Release v1.0.0 | |
body: | | |
## Notas de Release | |
- Adicione notas de release aqui | |
- Você pode incluir informações sobre as alterações, correções ou melhorias |