Skip to content

feat(CI - Github Actions): added build new release #15

feat(CI - Github Actions): added build new release

feat(CI - Github Actions): added build new release #15

Workflow file for this run

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
release:
runs-on: ubuntu-latest
needs: build
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
steps:
- uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: minor