Skip to content

Commit 5a02122

Browse files
authored
Merge pull request #18 from maxcnunes/fix-ci
Fix CI tasks
2 parents 1fde628 + edee555 commit 5a02122

File tree

11 files changed

+92
-83
lines changed

11 files changed

+92
-83
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- '*'
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
-
17+
name: Checkout
18+
uses: actions/checkout@v2
19+
with:
20+
fetch-depth: 0
21+
-
22+
name: Fetch all tags
23+
run: git fetch --force --tags
24+
-
25+
name: Set up Go
26+
uses: actions/setup-go@v2
27+
with:
28+
go-version: 1.19
29+
-
30+
name: Run GoReleaser
31+
uses: goreleaser/goreleaser-action@v2
32+
with:
33+
distribution: goreleaser
34+
version: latest
35+
args: release --rm-dist
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/workflow.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: dev-workflow
2+
3+
on:
4+
- push
5+
jobs:
6+
run:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os:
11+
- ubuntu-latest
12+
# - macos-latest
13+
# - windows-latest
14+
go:
15+
- '1.19'
16+
# - '1.18'
17+
# - '1.17'
18+
# - '1.16'
19+
# - '1.15'
20+
env:
21+
OS: ${{ matrix.os }}
22+
steps:
23+
- uses: actions/checkout@master
24+
25+
- name: Setup Go
26+
uses: actions/setup-go@v3
27+
with:
28+
go-version: ${{ matrix.go }}
29+
30+
- name: golangci-lint
31+
uses: golangci/golangci-lint-action@v3
32+
with:
33+
version: v1.48
34+
35+
- name: Test
36+
run: make test
37+
38+
- name: Upload coverage to Codecov
39+
uses: codecov/codecov-action@v3

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,6 @@ A single test:
5555
go test -run TestSimplePost ./...
5656
```
5757

58+
### Release
59+
60+
The release runs automatically with a Github action on pushed git tags.

Makefile

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,14 @@ TEST_PACKAGES := $(shell go list ./... | grep -v cmd)
33
COVER_PACKAGES := $(shell go list ./... | grep -v cmd | paste -sd "," -)
44
LINTER := $(shell command -v gometalinter 2> /dev/null)
55

6-
.PHONY: setup
7-
8-
setup:
9-
ifndef LINTER
10-
@echo "Installing linter"
11-
@go get -u github.com/alecthomas/gometalinter
12-
@gometalinter --install
13-
endif
14-
156
build:
167
@go build -o ./gaper cmd/gaper/main.go
178

189
## lint: Validate golang code
10+
# Install it following this doc https://golangci-lint.run/usage/install/#local-installation,
11+
# please use the same version from .github/workflows/workflow.yml.
1912
lint:
20-
@gometalinter \
21-
--deadline=120s \
22-
--line-length=120 \
23-
--enable-all \
24-
--disable=gochecknoinits --disable=gochecknoglobals \
25-
--vendor ./...
13+
@golangci-lint run
2614

2715
test:
2816
@go test -p=1 -coverpkg $(COVER_PACKAGES) \

appveyor.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

builder.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ type Builder interface {
1717
type builder struct {
1818
dir string
1919
binary string
20-
errors string
2120
wd string
2221
buildArgs []string
2322
}

gaper.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,7 @@ func setupConfig(cfg *Config) error {
212212
var extensions []string
213213
for i := range cfg.Extensions {
214214
values := strings.Split(cfg.Extensions[i], ",")
215-
for _, e := range values {
216-
extensions = append(extensions, e)
217-
}
215+
extensions = append(extensions, values...)
218216
}
219217
cfg.Extensions = extensions
220218

testdata/.hidden-file

Whitespace-only changes.

testdata/.hidden-folder/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)