Skip to content

Commit 9afd6d4

Browse files
authored
Migrate from Travis CI to GitHub Actions (#61)
* Migrate from Travis CI to GitHub Actions Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com> * Fix gofmt Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
1 parent a879606 commit 9afd6d4

File tree

8 files changed

+63
-37
lines changed

8 files changed

+63
-37
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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
# No Windows this time. Some tests expect Unix-style paths.
12+
os: [ ubuntu-latest, macos-latest ]
13+
fail-fast: false
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Go
19+
uses: actions/setup-go@v2
20+
with:
21+
# Due to https://github.com/go-openapi/swag/issues/59
22+
go-version: 1.16
23+
24+
- name: Setup gotestsum
25+
uses: autero1/action-gotestsum@v1.0.0
26+
with:
27+
gotestsum_version: 1.7.0
28+
29+
- name: Test
30+
run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./...
31+
32+
- uses: codecov/codecov-action@v2
33+
with:
34+
files: coverage_txt
35+
36+
lint:
37+
runs-on: ${{ matrix.os }}
38+
39+
strategy:
40+
matrix:
41+
os: [ ubuntu-latest, macos-latest, windows-latest ]
42+
fail-fast: false
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: golangci/golangci-lint-action@v2
47+
with:
48+
args: --timeout=5m

.golangci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,12 @@ linters:
3939
- paralleltest
4040
- thelper
4141
- ifshort
42+
- gomoddirectives
43+
- cyclop
44+
- forcetypeassert
45+
- ireturn
46+
- tagliatelle
47+
- varnamelen
48+
- goimports
49+
- tenv
50+
- golint

.travis.yml

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

post_go18.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build go1.8
1516
// +build go1.8
1617

1718
package swag

post_go19.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build go1.9
1516
// +build go1.9
1617

1718
package swag

pre_go18.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build !go1.8
1516
// +build !go1.8
1617

1718
package swag

pre_go19.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
//go:build !go1.9
1516
// +build !go1.9
1617

1718
package swag

0 commit comments

Comments
 (0)