Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from nspcc-dev/add-ci-github-actions
Browse files Browse the repository at this point in the history
Add ci GitHub actions
  • Loading branch information
im-kulikov authored Nov 21, 2019
2 parents 5aea5b4 + 165dc9a commit 5d4759a
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 12 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Go
on: [push]
jobs:

test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.11.x', '1.12.x', '1.13.x']
steps:

- name: Setup go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Set GOPATH
# temporary fix
# see https://github.com/actions/setup-go/issues/14
run: |
echo "##[set-env name=GOPATH;]$(dirname $GITHUB_WORKSPACE)"
echo "##[add-path]$(dirname $GITHUB_WORKSPACE)/bin"
shell: bash

- name: Get dependencies
run: |
go get -u -v golang.org/x/lint/golint
go mod tidy -v
- name: Linter
run: golint -set_exit_status ./...

- name: Tests
run: go test -coverprofile=coverage.txt -covermode=atomic ./...

- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion container/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type (
UUID = refs.UUID
// OwnerID type alias.
OwnerID = refs.OwnerID
// OwnerID type alias.
// MessageID type alias.
MessageID = refs.MessageID
)

Expand Down
2 changes: 1 addition & 1 deletion container/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func (m *Container) Empty() bool {
}

// -- Test container definition -- //

// NewTestContainer returns test container.
//
// WARNING: DON'T USE THIS OUTSIDE TESTS.
func NewTestContainer() (*Container, error) {
key := test.DecodeKey(0)
Expand Down
7 changes: 0 additions & 7 deletions proto.go

This file was deleted.

5 changes: 2 additions & 3 deletions session/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (m *Token) Verify(keys ...*ecdsa.PublicKey) bool {
return false
}

// Sign adds token signatures.
// AddSignatures adds token signatures.
func (t *PToken) AddSignatures(signH, signT []byte) {
t.mtx.Lock()

Expand All @@ -139,8 +139,7 @@ func (t *PToken) SignData(data []byte) ([]byte, error) {
return crypto.Sign(t.PrivateKey, data)
}

// VerifyData checks if signature of data by token t
// is equal to sign.
// VerifyData checks if signature of data by token is equal to sign.
func (m *VerificationHeader) VerifyData(data, sign []byte) error {
if crypto.Verify(crypto.UnmarshalPublicKey(m.PublicKey), data, sign) != nil {
return ErrInvalidSignature
Expand Down

0 comments on commit 5d4759a

Please sign in to comment.