-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #117 from bombsimon/gh-actions
chore: Switch to GitHub Actions
- Loading branch information
Showing
8 changed files
with
182 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
name: CI | ||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
- uses: actions/checkout@v3 | ||
- uses: golangci/golangci-lint-action@v3 | ||
|
||
tests: | ||
# run after golangci-lint action to not produce duplicated errors | ||
name: tests | ||
needs: golangci-lint | ||
strategy: | ||
matrix: | ||
go: | ||
- '1.20' | ||
os: | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: ${{ runner.os }}-go- | ||
|
||
- name: Test code | ||
run: go test -race -v ./... | ||
|
||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
if: success() | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Calc coverage | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
go test -v -covermode=count -coverprofile=coverage.out | ||
- name: Convert coverage to lcov | ||
uses: jandelgado/gcov2lcov-action@v1.0.9 | ||
with: | ||
infile: coverage.out | ||
outfile: coverage.lcov | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@1.1.3 | ||
with: | ||
github-token: ${{ secrets.github_token }} | ||
path-to-lcov: coverage.lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
run: | ||
deadline: 1m | ||
issues-exit-code: 1 | ||
tests: true | ||
skip-dirs: | ||
- vendor$ | ||
|
||
output: | ||
format: colored-line-number | ||
print-issued-lines: false | ||
|
||
linters-settings: | ||
gocognit: | ||
min-complexity: 10 | ||
|
||
depguard: | ||
list-type: blacklist | ||
include-go-root: false | ||
packages: | ||
- github.com/davecgh/go-spew/spew | ||
|
||
misspell: | ||
locale: US | ||
|
||
gocritic: | ||
# Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` | ||
# to see all tags and checks. Empty list by default. See | ||
# https://github.com/go-critic/go-critic#usage -> section "Tags". | ||
enabled-tags: | ||
- diagnostic | ||
- experimental | ||
- opinionated | ||
- performance | ||
- style | ||
|
||
linters: | ||
enable-all: true | ||
disable: | ||
- cyclop | ||
- deadcode | ||
- dupl | ||
- dupword | ||
- exhaustivestruct | ||
- exhaustruct | ||
- forbidigo | ||
- funlen | ||
- gci | ||
- gocognit | ||
- gocyclo | ||
- godox | ||
- golint | ||
- gomnd | ||
- ifshort | ||
- interfacer | ||
- lll | ||
- maintidx | ||
- maligned | ||
- nakedret | ||
- nestif | ||
- nlreturn | ||
- nosnakecase | ||
- paralleltest | ||
- prealloc | ||
- scopelint | ||
- structcheck | ||
- testpackage | ||
- varcheck | ||
- varnamelen | ||
fast: false | ||
|
||
|
||
issues: | ||
exclude-use-default: true | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
|
||
# vim: set sw=2 ts=2 et: |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ import ( | |
"github.com/bombsimon/wsl/v3" | ||
) | ||
|
||
// nolint: gocognit | ||
func main() { | ||
var ( | ||
args []string | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
module github.com/bombsimon/wsl/v3 | ||
|
||
go 1.12 | ||
go 1.19 | ||
|
||
require github.com/stretchr/testify v1.8.1 | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/kr/text v0.2.0 // indirect | ||
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect | ||
github.com/stretchr/testify v1.5.1 | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect | ||
gopkg.in/yaml.v2 v2.2.8 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters