Add dockerfile (#4) #16
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: Integração Contínua | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.22' | |
- name: Inicia banco | |
run: docker compose up -d postgres | |
- name: Lint | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.59 | |
args: controllers/ database/ models/ routes/ | |
- name: Test | |
run: DB_HOST=${{ secrets.DB_HOST }} DB_PASSWORD=${{ secrets.DB_PASSWORD }} DB_USER=${{ secrets.DB_USER }} DB_NAME=${{ secrets.DB_NAME }} DB_PORT=${{ secrets.DB_PORT }} go test -v main_test.go | |
- name: Build | |
run: go build main.go | |
- name: Projeto compilado | |
uses: actions/upload-artifact@v4 | |
with: | |
name: projeto_compilado | |
path: main |