Add Row Count Function #52
Workflow file for this run
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
# 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 |