Skip to content

Commit

Permalink
add setup go and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandrolaxx committed Jul 13, 2024
1 parent 65e7146 commit 4388865
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"

- name: Run tests
run: go test

- name: Generate SHA
id: generate_sha
run: |
Expand Down
13 changes: 13 additions & 0 deletions devops-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,17 @@ Revisando, ficará da seguinte forma:
tags: |
sandrolax/api-journey:${{ steps.generate_sha.outputs.sha }}
sandrolax/api-journey:latest
```

**Steps adicionais**: Poderiamos adicionar também um step para realizar os testes unitários, para isso é necessário ter o go na máquina onde roda o job, então precisamos instalar o go e então rodar os testes unitários.

Exemplo abaixo:
```
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.22.5"
- name: Run tests
run: go test
```

0 comments on commit 4388865

Please sign in to comment.