Skip to content

IND-2293 test.yml updated with unit test coverage and linting #137

IND-2293 test.yml updated with unit test coverage and linting

IND-2293 test.yml updated with unit test coverage and linting #137

Workflow file for this run

name: go-hclog
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version:
- 'oldstable'
- 'stable'
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Install Go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Run golangci-lint
uses: golangci/golangci-lint-action@08e2f20817b15149a52b5b3ebe7de50aff2ba8c5
- name: Run test and generate coverage report
run: go test -v -coverprofile=coverage.out ./...
- name: Upload coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
path: coverage.out
name: Coverage-report
- name: Display coverage report
run: go tool cover -func=coverage.out
- name: Build Go
run: go build ./...