From c4797d2211c3b746658a396bb8adffec26f3df1c Mon Sep 17 00:00:00 2001 From: Stuart McLaren Date: Tue, 20 Aug 2024 16:51:17 +0100 Subject: [PATCH] Makefile: add build and test targets --- .github/workflows/build.yaml | 18 ++++++++++++++++++ Makefile | 6 ++++++ 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..a909ee5 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,18 @@ +# Copyright 2024 Hewlett Packard Enterprise Development LP +name: Build + +on: [push, pull_request] +jobs: + ci: + runs-on: ubuntu-20.04 + strategy: + matrix: + go: [ '1.21' ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - run: go version + - run: make build + - run: make test diff --git a/Makefile b/Makefile index cd84caf..4550d72 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,12 @@ # # Note: this Makefile works with GNUMake and BSDMake # +build: + go build ./... + +test: + go test ./... + lint: @golangci-lint --version # Will use .golangci.yml