Caso você enfrente alguns problemas relacionados ao docker compose, no lugar onde o professor usa docker-compose
remova o -
deixando apenas o docker compose
`# 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: push: branches: [ "" ] pull_request: branches: [ "" ] workflow_dispatch:
jobs:
test: runs-on: ${{matrix.os}} env: HOST: localhost PORT: 5432 USER: root PASSWORD: root DBNAME: root strategy: matrix: go_version: ['1.18'] os: ['ubuntu-latest'] steps: - uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build-DB
run: docker compose build
- name: Create-DB
run: docker compose up -d
- name: Test
run: go test -v main_test.go
build: needs: test runs-on: 'ubuntu-latest' steps: - uses: actions/checkout@v3
- name: Build
run: go build -v main.go
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4.3.1
with:
# Artifact name
name: go api
# A file, directory or wildcard pattern that describes what to upload
path: main
# The desired behavior if no files are found using the provided path.
docker: needs: build uses: ./.github/workflows/Docker.yml secrets: inherit`