Create go.yml
This commit is contained in:
parent
e121e164ce
commit
7e414ac89d
1 changed files with 44 additions and 0 deletions
44
.github/workflows/go.yml
vendored
Normal file
44
.github/workflows/go.yml
vendored
Normal 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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue