Skip to content

add git history for linter #2

add git history for linter

add git history for linter #2

Workflow file for this run

name: Test
on:
push:
branches:
- "**"
jobs:
test:
runs-on: ubuntu-latest
services:
minio:
image: bitnami/minio:latest
env:
MINIO_ROOT_USER: minio
MINIO_ROOT_PASSWORD: minio123
ports:
- 9000:9000
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up go
uses: actions/setup-go@v4
with:
go-version-file: 'go.mod'
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# - name: Setup Go and Git for private modules
# run: |
# go env -w GOPRIVATE=github.com/whalebone/*
# git config --global url."https://${{ secrets.GH_USERNAME }}:${{ secrets.GH_TOKEN }}@github.com".insteadOf "https://github.com"
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: latest
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
skip-pkg-cache: true
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
skip-build-cache: true
- name: Test Go packages
run: |
go test -v -covermode=atomic -coverpkg=./... -coverprofile coverage.out ./... -p=1 count=1 -cpu 2
go tool cover -func=coverage.out