Skip to content

Commit 94a01a9

Browse files
committed
add .github/workflows
1 parent b71ab26 commit 94a01a9

4 files changed

Lines changed: 93 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build by matrix
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: |
7+
0 0 * * *
8+
push:
9+
tags:
10+
- v*
11+
branches:
12+
- main
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x]
20+
os: [ubuntu-latest, macos-latest, windows-latest]
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-go@v2
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
- name: Go build
27+
run: go build ./cmd/git-semv

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Lint by GolangCI LInt
2+
on:
3+
pull_request:
4+
schedule:
5+
- cron: |
6+
0 0 * * *
7+
push:
8+
tags:
9+
- v*
10+
branches:
11+
- main
12+
jobs:
13+
golangci:
14+
name: GolongCI Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: golangci/golangci-lint-action@v2
19+
with:
20+
version: latest

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Release by GoReleaser
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
jobs:
7+
goreleaser:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
with:
13+
fetch-depth: 0
14+
- name: Set up Go
15+
uses: actions/setup-go@v2
16+
with:
17+
go-version: 1.16
18+
- name: Run goreleaser
19+
uses: goreleaser/goreleaser-action@v2
20+
with:
21+
version: latest
22+
args: release --rm-dist
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
on:
3+
push:
4+
pull_request:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: |
8+
0 0 * * *
9+
jobs:
10+
test:
11+
name: Unit test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
go-version: [1.13.x, 1.14.x, 1.15.x, 1.16.x]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-go@v2
19+
with:
20+
go-version: ${{ matrix.go-version }}
21+
- name: Go test
22+
run: go test -v

0 commit comments

Comments
 (0)