Skip to content

Commit

Permalink
ci: creating github actions config (#22)
Browse files Browse the repository at this point in the history
* ci: creating github actions config

* ci: bump setup-go version

* ci: add lint pipeline

* ci: fix go version
  • Loading branch information
henriqueholanda authored Aug 19, 2024
1 parent fb6afb1 commit 4b8a986
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 37 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: pipeline

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'

- name: Install dependencies
run: make depend

- name: Run tests
run: make test
25 changes: 25 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: golangci-lint
on:
push:
branches:
- main
- master
pull_request:

permissions:
contents: read
pull-requests: read

jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

22 changes: 1 addition & 21 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,14 @@ cover: test

# Download dependencies
depend:
@go get -u gopkg.in/alecthomas/gometalinter.v2
@gometalinter.v2 --install
go mod tidy
.PHONY: depend

# Format all go files
fmt:
gofmt -s -w -l $(shell go list -f {{.Dir}} ./...)
.PHONY: fmt

# Run linters
lint:
@gometalinter.v2 \
--disable-all \
--exclude=vendor \
--deadline=180s \
--enable=gofmt \
--linter='errch:errcheck {path}:PATH:LINE:MESSAGE' \
--enable=errch \
--enable=vet \
--enable=gocyclo \
--cyclo-over=15 \
--enable=golint \
--min-confidence=0.85 \
--enable=ineffassign \
--enable=misspell \
./..
.PHONY: lint

# Run tests
test:
@go test -v -race -coverprofile=./coverage.text -covermode=atomic $(shell go list ./...)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Brazanation Documents - Golang

[![Build Status](https://img.shields.io/travis/brazanation/go-documents/master.svg?style=flat-square)](https://travis-ci.org/brazanation/go-documents)
![Build status]((https://github.com/brazanation/go-documents/actions/workflows/actions.yml/badge.svg))
[![Codecov branch](https://img.shields.io/codecov/c/github/brazanation/go-documents/master.svg?style=flat-square)](https://codecov.io/gh/brazanation/go-documents)
[![GoDoc](https://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/brazanation/go-documents)
[![Go Report Card](https://goreportcard.com/badge/github.com/brazanation/go-documents?style=flat-square)](https://goreportcard.com/report/github.com/brazanation/go-documents)
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/brazanation/go-documents

go 1.22
Empty file added go.sum
Empty file.

0 comments on commit 4b8a986

Please sign in to comment.