-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (39 loc) · 1.05 KB
/
push.yml
File metadata and controls
43 lines (39 loc) · 1.05 KB
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
# .github/workflows/go.yml
name: Go Build and Test Workflow
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
GO_VERSION: 1.20.x
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- name: Compile
run: go mod download && go mod tidy -v -x -e && go build -v ./... && chmod a+rx ./gh-commit && ./gh-commit
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@v2
- name: Get dependencies
run: go mod download
- name: Run tests
run: go test -v ./...
- name: Install
run: gh extension install ghcli/gh-commit-src && gh commit-src