chore: upgrade dependencies and go version #9
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: 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 | |
minio-cloud: | |
image: bitnami/minio:latest | |
env: | |
MINIO_ROOT_USER: minio-cloud | |
MINIO_ROOT_PASSWORD: minio-cloud123 | |
ports: | |
- 19000: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 |