From 7e414ac89da130fed34364a5e444a9ce7f916a9e Mon Sep 17 00:00:00 2001 From: Mani Arasteh Date: Sat, 1 Jun 2024 13:05:13 +0330 Subject: [PATCH] Create go.yml --- .github/workflows/go.yml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 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..f7ea2ee --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,44 @@ +# 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" ] + pull_request: + branches: [ "master" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... + + - name: Setup Go environment + uses: actions/setup-go@v5.0.1 + with: + # The Go version to download (if necessary) and use. Supports semver spec and ranges. Be sure to enclose this option in single quotation marks. + go-version: 1.22.3 + # Path to the go.mod or go.work file. + go-version-file: ../../go.mod + # Set this option to true if you want the action to always check for the latest available version that satisfies the version spec + check-latest: true + # Used to specify whether caching is needed. Set to true, if you'd like to enable caching. + cache: true + # Used to specify the path to a dependency file - go.sum + cache-dependency-path: ../../go.sum + +