Skip to content

Fix go version in GitHub actions #4

Fix go version in GitHub actions

Fix go version in GitHub actions #4

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: Go
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
cache-dependency-path: "**/go.sum"
- name: Build promdump
working-directory: ./promdump
run: |
go get
go build -ldflags=" -X 'main.CommitHash=$(git rev-parse HEAD)' -X 'main.BuildTime=$(date -Iseconds)'" -v ./...
- name: Test promdump
working-directory: ./promdump
run: go test -v ./...
- name: Compress artifacts
run: |
gzip promdump/promdump
- name: Upload promdump
uses: actions/upload-artifact@v4
with:
name: promdump
path: promdump/promdump.gz