Skip to content

Commit

Permalink
fix: update Go and CI / tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shibumi authored and ashcrow committed Feb 3, 2022
1 parent 0789fa5 commit 77b4cfe
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 5 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
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
17 changes: 17 additions & 0 deletions .golangci.yaml
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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# packageurl-go

Go implementation of the package url spec

[![Build Status](https://travis-ci.com/package-url/packageurl-go.svg)](https://travis-ci.com/package-url/packageurl-go)
Go implementation of the package url spec.


## Install
Expand Down Expand Up @@ -55,7 +53,7 @@ func main() {


## Test
Testing using the normal ``go test`` command. Using ``make test`` will pull down the test fixtures shared between all package-url projects and then execute the tests.
Testing using the normal ``go test`` command. Using ``make test`` will pull the test fixtures shared between all package-url projects and then execute the tests.

```
$ make test
Expand Down
2 changes: 1 addition & 1 deletion go.mod
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

0 comments on commit 77b4cfe

Please sign in to comment.