Skip to content

Commit

Permalink
chore: Add lint and testing
Browse files Browse the repository at this point in the history
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Aug 15, 2021
1 parent ca4dd91 commit f1190db
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 62 deletions.
38 changes: 0 additions & 38 deletions .drone.yml

This file was deleted.

25 changes: 2 additions & 23 deletions .github/workflows/go.yml → .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
name: Run Tests

on:
push:
branches:
- main
pull_request:
branches:
- main
name: Run CI Lint
on: push

jobs:
test:
Expand All @@ -17,13 +10,6 @@ jobs:
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}

# Service containers to run with `container-job`
services:
nats:
image: nats
ports:
- 4222:4222

env:
GO111MODULE: on
TESTTAGS: ${{ matrix.test-tags }}
Expand All @@ -43,10 +29,3 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: v1.41.1

- name: Run Tests
run: |
go test -v -covermode=atomic -coverprofile=coverage.out .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
34 changes: 34 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Run Testing
on: push

jobs:
# Label of the container job
runner-job:
# You must use a Linux environment when using service containers or container jobs
runs-on: ubuntu-latest

# Service containers to run with `container-job`
services:
nats:
image: nats
ports:
- 4222:4222

env:
GO111MODULE: on
GOPROXY: https://proxy.golang.org
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2

- name: Checkout Code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}

- name: Run Tests
run: |
go test -v -covermode=atomic -coverprofile=coverage.out .
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion nats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/stretchr/testify/assert"
)

var host = "nats"
var host = "127.0.0.1"

type mockMessage struct {
Message string
Expand Down

0 comments on commit f1190db

Please sign in to comment.