forked from niondir/go-service
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.07 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build
on:
push:
branches:
- main
- feature/**
- update/**
- fix/**
- dependabot/**
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
types: [ opened, edited ,reopened ]
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
concurrency:
group: "${{ github.workflow }}-${{ (github.ref_type == 'tag') && 'main' || github.ref_name }}"
cancel-in-progress: ${{ github.ref_type == 'tag' || github.ref_name != 'main' }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
CGO_ENABLED: 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: true
- name: install go dependencies
run: go mod download all
- name: go generate
run: go generate ./...
- name: Test
run: go test ./...
# If a build fails due to a missing go.sum entry: Run `go mod tidy`, then `go mod download all` and commit the changes.
#build-go