Skip to content

Commit 2b0812a

Browse files
authored
Merge pull request #144 from kzys/gha
Migrate from Travis CI to GitHub Actions
2 parents cd349c2 + 967ff72 commit 2b0812a

File tree

5 files changed

+62
-56
lines changed

5 files changed

+62
-56
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# gofmt always uses LF, whereas Git uses CRLF on Windows.
2+
*.go text eol=lf

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Go
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
os: [ ubuntu-latest, macos-latest, windows-latest ]
12+
fail-fast: false
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.17
21+
22+
- name: Setup gotestsum
23+
uses: autero1/action-gotestsum@v1.0.0
24+
with:
25+
gotestsum_version: 1.7.0
26+
27+
- name: Test
28+
run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./...
29+
30+
- uses: codecov/codecov-action@v2
31+
with:
32+
files: coverage_txt
33+
34+
lint:
35+
runs-on: ${{ matrix.os }}
36+
37+
strategy:
38+
matrix:
39+
os: [ ubuntu-latest, macos-latest, windows-latest ]
40+
fail-fast: false
41+
42+
steps:
43+
- uses: actions/checkout@v2
44+
- uses: golangci/golangci-lint-action@v2
45+
with:
46+
args: --timeout=5m

.golangci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,13 @@ linters:
4040
- godot
4141
- tparallel
4242
- paralleltest
43+
- cyclop # because we have gocyclo already
44+
# TODO: review the linters below. We disabled them to make the CI pass first.
45+
- gocritic
46+
- revive
47+
- containedctx
48+
- ireturn
49+
- varnamelen
50+
- forcetypeassert
51+
- thelper
52+
- wastedassign

.travis.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

formats_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ func TestStringValidation(t *testing.T) {
4646
}
4747

4848
testCases := []*testParams{
49-
&testParams{
49+
{
5050
format: "datetime",
5151
obj: strfmt.NewDateTime(),
5252
},
53-
&testParams{
53+
{
5454
format: "uuid",
5555
obj: strfmt.UUID("00000000-0000-0000-0000-000000000000"),
5656
},
57-
&testParams{
57+
{
5858
format: "email",
5959
obj: strfmt.Email("name@domain.tld"),
6060
},
61-
&testParams{
61+
{
6262
format: "bsonobjectid",
6363
obj: strfmt.NewObjectId("60a7903427a1e6666d2b998c"),
6464
},

0 commit comments

Comments
 (0)