Skip to content

Add Row Count Function #52

Add Row Count Function

Add Row Count Function #52

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Build gov.gsa.fac.cgov-util
env:
GO_VERSION: '1.22'
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- name: Install dependencies
run: |
go get .
go get github.com/google/uuid
go get github.com/bitfield/script
go get github.com/spf13/cobra
go get github.com/spf13/viper
go get github.com/tidwall/gjson
- name: Set outputs
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Build
run: go build -ldflags "-X main.SHA1=${{steps.vars.outputs.sha_short}}" -v ./...
- name: Test
run: go test -v ./...
- name: Test with Go
run: go test -json > test_results-${{ env.GO_VERSION }}.json
- name: Upload Go test results
uses: actions/upload-artifact@v4
with:
name: go_results-${{ env.GO_VERSION }}
path: test_results-${{ env.GO_VERSION }}.json