Create go.yml

This commit is contained in:
Mani Arasteh 2024-06-01 13:05:13 +03:30 committed by GitHub
parent e121e164ce
commit 7e414ac89d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

44
.github/workflows/go.yml vendored Normal file
View file

@ -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