-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
53 additions
and
5 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,33 @@ | ||
name: test | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
go-version: [1.16.x, 1.17.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Download test data | ||
run: curl -L https://raw.githubusercontent.com/package-url/purl-spec/master/test-suite-data.json -o testdata/test-suite-data.json | ||
- name: Test go fmt | ||
run: test -z $(go fmt ./...) | ||
- name: Golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
only-new-issues: true | ||
- name: Test coverage | ||
run: go test -covermode atomic -coverprofile='profile.cov' ./... | ||
- name: Send coverage | ||
if: runner.os == 'Linux' | ||
env: | ||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
GO111MODULE=off go get github.com/mattn/goveralls | ||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github |
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,17 @@ | ||
# individual linter configs go here | ||
linters-settings: | ||
|
||
# default linters are enabled `golangci-lint help linters` | ||
linters: | ||
disable-all: true | ||
enable: | ||
- deadcode | ||
- errcheck | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- structcheck | ||
- typecheck | ||
- unused | ||
- varcheck |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module github.com/package-url/packageurl-go | ||
|
||
go 1.12 | ||
go 1.17 |