2023-12-12 06:05:08 +05:30
|
|
|
name: Build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
tags:
|
|
|
|
- '*.*.*'
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
services:
|
|
|
|
redis:
|
|
|
|
image: redis:7-alpine
|
|
|
|
options: >-
|
|
|
|
--health-cmd "redis-cli ping"
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
ports:
|
|
|
|
- 6379:6379
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
cache-dependency-path: go.sum
|
|
|
|
go-version-file: go.mod
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: go get .
|
|
|
|
|
|
|
|
- name: Go Format
|
|
|
|
run: gofmt -s -w . && git diff --exit-code
|
|
|
|
|
|
|
|
- name: Go Vet
|
|
|
|
run: go vet ./...
|
|
|
|
|
|
|
|
- name: Go Test
|
|
|
|
run: go test -v -race --tags redis -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
|
2023-12-13 21:39:46 +05:30
|
|
|
- name: Upload coverage to Codecov
|
|
|
|
uses: codecov/codecov-action@v4-beta
|
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
|
2023-12-12 06:05:08 +05:30
|
|
|
- name: Build
|
|
|
|
run: go build ./...
|