Skip to content

Commit

Permalink
Migrate from Travis CI to GitHub Actions (#61)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
kzys committed Jan 29, 2022
1 parent a879606 commit 9afd6d4
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 37 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# gofmt always uses LF, whereas Git uses CRLF on Windows.
*.go text eol=lf
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Go

on: [push, pull_request]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
# No Windows this time. Some tests expect Unix-style paths.
os: [ ubuntu-latest, macos-latest ]
fail-fast: false

steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
# Due to https://github.com/go-openapi/swag/issues/59
go-version: 1.16

- name: Setup gotestsum
uses: autero1/action-gotestsum@v1.0.0
with:
gotestsum_version: 1.7.0

- name: Test
run: gotestsum --format short-verbose -- -race -timeout=20m -coverprofile=coverage_txt -covermode=atomic ./...

- uses: codecov/codecov-action@v2
with:
files: coverage_txt

lint:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2
with:
args: --timeout=5m
9 changes: 9 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,12 @@ linters:
- paralleltest
- thelper
- ifshort
- gomoddirectives
- cyclop
- forcetypeassert
- ireturn
- tagliatelle
- varnamelen
- goimports
- tenv
- golint
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions post_go18.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.8
// +build go1.8

package swag
Expand Down
1 change: 1 addition & 0 deletions post_go19.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.9
// +build go1.9

package swag
Expand Down
1 change: 1 addition & 0 deletions pre_go18.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !go1.8
// +build !go1.8

package swag
Expand Down
1 change: 1 addition & 0 deletions pre_go19.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build !go1.9
// +build !go1.9

package swag
Expand Down

0 comments on commit 9afd6d4

Please sign in to comment.