implement testify, update workflow #7
Workflow file for this run
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 Test | |
on: | |
push: | |
branches: | |
- "*" | |
- "*/*" | |
pull_request: | |
branches: | |
- "*" | |
- "*/*" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
matrix: | |
go-version: ["1.20.x"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Display Go version | |
run: go version | |
- name: Verify dependencies | |
run: go mod verify | |
- name: Create Keys Directory | |
run: mkdir -p keys | |
working-directory: ${{ github.workspace }} | |
- name: Generate Self-Signed TLS Certificate | |
run: | | |
openssl req -x509 -newkey rsa:4096 -keyout keys/private.key -out keys/publickey.crt -days 365 -nodes -subj "/CN=localhost" | |
working-directory: ${{ github.workspace }} | |
- name: Show Certificate | |
run: | | |
cat keys/publickey.crt | |
cat keys/private.key | |
- name: Create .env file | |
run: echo "${{ secrets.ENV }}" > .env | |
- name: Go Get | |
run: | | |
go get . | |
go run database/migration/main.go | |
- name: Run Test | |
run: | | |
go test -p 1 -timeout 600s ./application/... | |
go test -race -timeout 600s ./controller/... ./database/... ./domain/.. ./internal/... ./repository/... ./service/... |