Skip to content

workflow updation

workflow updation #205

Workflow file for this run

name: Checks
on:
push:
branches:
- build
jobs:
unit_tests:
strategy:
matrix:
include:
- runs-on: ubuntu-latest
target: linux_amd64
- runs-on: windows-latest
target: windows_amd64
- runs-on: macos-latest
target: darwin_amd64
fail-fast: false
name: "Unit Tests on ${{ matrix.target }}"
runs-on: "${{ matrix.runs-on }}"
steps:
- name: "Disable git crlf conversions"
if: ${{ runner.os == 'Windows' }}
# HCL preserves the input line endings when processing a heredoc,
# and our tests for heredocs are written to expect the result for
# the source code as checked in to the repository, so git's normal
# tampering with the line endings would invalidate those tests.
run: |
git config --global core.autocrlf false
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- name: Go test
run: |
go test -v -race -coverprofile="coverage.out" ./...
- name: Upload coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
path: coverage.out
name: coverage-report-${{matrix.target}}
- name: Display coverage report # displayed only for linux and macOS
if: ${{runner.os != 'Windows'}}
run: go tool cover -func=coverage.out
- name: Build go
run: go build ./...
copyright:
name: "copyright headers"
runs-on: ubuntu-latest
steps:
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version: "1.23"
- name: "copyright headers check"
run: |
make copyrightcheck
govet:
name: "go vet"
runs-on: ubuntu-latest
steps:
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- name: "go vet"
run: |
make vetcheck
gofmt:
name: "gofmt"
runs-on: ubuntu-latest
steps:
- name: "Fetch source code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Go
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
with:
go-version-file: go.mod
- name: "gofmt"
run: |
make fmtcheck