Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(project): Add GitHub Actions testing workflow #289

Merged
merged 6 commits into from
May 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Test and lint
strategy:
matrix:
go-version: [1.x, 1.13.x, 1.12.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.14

# Caching go modules to speed up the run
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-

- name: Run go fmt
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(gofmt -d -s .)

- name: Run go vet
run: make vet

- name: Run staticcheck
run: make staticcheck

- name: Run Unit tests.
run: make test
7 changes: 3 additions & 4 deletions metaissue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package jira
import (
"fmt"
"net/http"
"strings"
"net/url"
"testing"
)

Expand Down Expand Up @@ -451,9 +451,8 @@ func TestIssueService_GetEditMeta_Fail(t *testing.T) {
t.Error("Expected to receive an error, received nil instead")
}

expectedError := "connection refused"
if !strings.Contains(err.Error(), expectedError) {
t.Errorf("Expected to receive error containing %s, received %v instead", expectedError, err.Error())
if _, ok := err.(*url.Error); !ok {
t.Errorf("Expected to receive an *url.Error, got %T instead", err)
}
}

Expand Down