Skip to content

Commit f1190db

Browse files
committed
chore: Add lint and testing
Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent ca4dd91 commit f1190db

File tree

4 files changed

+37
-62
lines changed

4 files changed

+37
-62
lines changed

.drone.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
name: Run Tests
2-
3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
1+
name: Run CI Lint
2+
on: push
103

114
jobs:
125
test:
@@ -17,13 +10,6 @@ jobs:
1710
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
1811
runs-on: ${{ matrix.os }}
1912

20-
# Service containers to run with `container-job`
21-
services:
22-
nats:
23-
image: nats
24-
ports:
25-
- 4222:4222
26-
2713
env:
2814
GO111MODULE: on
2915
TESTTAGS: ${{ matrix.test-tags }}
@@ -43,10 +29,3 @@ jobs:
4329
uses: golangci/golangci-lint-action@v2
4430
with:
4531
version: v1.41.1
46-
47-
- name: Run Tests
48-
run: |
49-
go test -v -covermode=atomic -coverprofile=coverage.out .
50-
51-
- name: Upload coverage to Codecov
52-
uses: codecov/codecov-action@v1

.github/workflows/testing.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Run Testing
2+
on: push
3+
4+
jobs:
5+
# Label of the container job
6+
runner-job:
7+
# You must use a Linux environment when using service containers or container jobs
8+
runs-on: ubuntu-latest
9+
10+
# Service containers to run with `container-job`
11+
services:
12+
nats:
13+
image: nats
14+
ports:
15+
- 4222:4222
16+
17+
env:
18+
GO111MODULE: on
19+
GOPROXY: https://proxy.golang.org
20+
steps:
21+
- name: Set up Go ${{ matrix.go }}
22+
uses: actions/setup-go@v2
23+
24+
- name: Checkout Code
25+
uses: actions/checkout@v2
26+
with:
27+
ref: ${{ github.ref }}
28+
29+
- name: Run Tests
30+
run: |
31+
go test -v -covermode=atomic -coverprofile=coverage.out .
32+
33+
- name: Upload coverage to Codecov
34+
uses: codecov/codecov-action@v1

nats_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/stretchr/testify/assert"
1515
)
1616

17-
var host = "nats"
17+
var host = "127.0.0.1"
1818

1919
type mockMessage struct {
2020
Message string

0 commit comments

Comments
 (0)