Skip to content

Merge pull request #29 from UnitVectorY-Labs/dependabot/github_action… #59

Merge pull request #29 from UnitVectorY-Labs/dependabot/github_action…

Merge pull request #29 from UnitVectorY-Labs/dependabot/github_action… #59

Workflow file for this run

# .github/workflows/build-go.yml
name: Build and Test Go Application
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version: '1.27.1' # GOVERSION
- name: Cache Go modules
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install dependencies
run: go mod download
- name: Build the application
run: go build -v ./...
- name: Run tests
run: go test -coverprofile=coverage.txt -covermode=atomic ./...