Skip to content

Commit

Permalink
feat: Upgrades for dependencies and added Github Actions (#20)
Browse files Browse the repository at this point in the history
I've upgraded just about all the dependencies that are used to be the
latest version (some major versions required still). Some dev tooling
dependencies were also updated.

I also switched things over to using Github Actions instead of Travis
CI.
  • Loading branch information
durandj authored Jun 8, 2022
1 parent df41e55 commit 3c65046
Show file tree
Hide file tree
Showing 15 changed files with 299 additions and 186 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ indent_style = tab
indent_size = 4
charset = utf-8

[*.yml]
[*.{yml,yaml}]
indent_style = space
indent_size = 2
45 changes: 45 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CD

on:
push:
branches:
- 'master'

jobs:
verify:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: arduino/setup-task@v1
- uses: actions/checkout@v3
- name: Install Ginkgo
run: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
- uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3
- name: Test
run: task test
- name: Build
run: task build

release:
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: actions/checkout@v3
- uses: go-semantic-release/action@v1
id: semrel
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
pull_request:
branches:
- '**'

jobs:
verify:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18
- uses: arduino/setup-task@v1
- uses: actions/checkout@v3
- name: Install Ginkgo
run: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
- uses: actions/checkout@v3
- name: Lint
uses: golangci/golangci-lint-action@v3
- name: Test
run: task test
- name: Build
run: task build
25 changes: 25 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
linters:
enable:
- bodyclose
- dupl
- errcheck
- exportloopref
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- govet
- lll
- nakedret
- prealloc
- revive
- staticcheck
- unconvert
- unparam
- whitespace

issues:
exclude-use-default: false
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-toml
- id: check-yaml
- id: detect-aws-credentials
- id: trailing-whitespace

- repo: https://github.com/golangci/golangci-lint
rev: v1.46.2
hooks:
- id: golangci-lint
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
golangci-lint 1.46.2
goreleaser 1.9.2
84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![Report Card](https://goreportcard.com/badge/github.com/durandj/git-ignore)](https://goreportcard.com/report/github.com/durandj/git-ignore)
[![Travis CI](https://travis-ci.org/durandj/git-ignore.svg?branch=master)](https://travis-ci.org/durandj/git-ignore)

# git-ignore

Expand Down Expand Up @@ -52,10 +51,11 @@ Make sure you first install the following dependencies:

### Dependencies

* Golang 1.11+
* Golang 1.18+
* [Ginkgo](http://onsi.github.io/ginkgo/)
* [GolangCI-Lint](https://github.com/golangci/golangci-lint)
* [Taskfile](https://taskfile.org)
* [Taskfile](https://taskfile.dev)
* [pre-commit](http://pre-commit.com/)

### Tasks

Expand Down
7 changes: 3 additions & 4 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# https://taskfile.org
# https://taskfile.dev

version: '2'
version: '3'

vars:
BIN: git-ignore
Expand Down Expand Up @@ -35,5 +35,4 @@ tasks:

test:
cmds:
- task: lint
- ginkgo -v -p -race --randomizeAllSpecs ./pkg/gitignore
- ginkgo -v -p -race --randomize-all ./pkg/gitignore
46 changes: 27 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
module github.com/durandj/git-ignore

go 1.18

require (
github.com/emirpasic/gods v1.12.0 // indirect
github.com/gliderlabs/ssh v0.1.3 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/onsi/ginkgo v1.8.0
github.com/onsi/gomega v1.5.0
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3 // indirect
github.com/stretchr/testify v1.3.0 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25 // indirect
golang.org/x/net v0.0.0-20190301231341-16b79f2e4e95 // indirect
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
golang.org/x/sys v0.0.0-20190306071516-a98ae47d97a5 // indirect
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.0 // indirect
gopkg.in/src-d/go-git-fixtures.v3 v3.3.0 // indirect
gopkg.in/src-d/go-git.v4 v4.10.0
gopkg.in/yaml.v2 v2.2.2 // indirect
github.com/onsi/gomega v1.19.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.4.0
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.1 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220531201128-c960675eff93 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1
gopkg.in/yaml.v2 v2.4.0 // indirect
)

require github.com/onsi/ginkgo/v2 v2.1.3

require (
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading

0 comments on commit 3c65046

Please sign in to comment.