Skip to content

Commit a44c8d3

Browse files
author
jguerreiro
committed
chore(ci): add golang actions
1 parent 679246c commit a44c8d3

File tree

3 files changed

+62
-5
lines changed

3 files changed

+62
-5
lines changed

.github/workflows/tag.yml

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

.github/workflows/test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
name: Build & Test
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Set up Go 1.16
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: 1.16
18+
id: go
19+
20+
- name: Check out code into the Go module directory
21+
uses: actions/checkout@v2
22+
23+
- name: Build
24+
run: go build -v .
25+
26+
- name: golangci-lint
27+
uses: golangci/golangci-lint-action@v2
28+
with:
29+
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
30+
version: v1.41
31+
32+
- name: Test
33+
run: |
34+
go test -race $(go list ./...) -v -coverprofile=.coverage.out
35+
go tool cover -func=.coverage.out

.goreleaser.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,3 @@ release:
3434
gitlab:
3535
owner: gg-code
3636
name: src-fingerprint
37-
38-
gitlab_urls:
39-
api: https://gitlab.gitguardian.ovh/api/v4/
40-
download: https://gitlab.gitguardian.ovh
41-
skip_tls_verify: false

0 commit comments

Comments
 (0)