From a787c59d32a7fa73734bceb0c4a13f4f5a5c8a97 Mon Sep 17 00:00:00 2001 From: Alysson Ribeiro <15274059+sonalys@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:04:38 +0100 Subject: [PATCH] Create go.yml --- .github/workflows/go.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..70ef675 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,40 @@ +# 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: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Cache + uses: actions/cache@v4.0.0 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-golang-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-golang- + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Test + run: go test -v ./... + + - name: Build + run: make build + +