8000 chore: switch travis to github actions. by appleboy · Pull Request #21 · gin-contrib/secure · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: switch travis to github actions. #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run Tests

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go: [1.13, 1.14, 1.15, 1.16]
name: ${{ matrix.os }} @ Go ${{ matrix.go }}
runs-on: ${{ matrix.os }}
env:
GO111MODULE: on
TESTTAGS: ${{ matrix.test-tags }}
GOPROXY: https://proxy.golang.org
steps:
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}

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

- name: golangci-lint
uses: golangci/golangci-lint-action@v2

- name: Run Tests
run: |
go install github.com/campoy/embedmd@latest
embedmd -d *.md
go test -v -covermode=atomic -coverprofile=coverage.out

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ func DefaultConfig() Config {
package main

import (
"log"

"github.com/gin-contrib/secure"
"github.com/gin-gonic/gin"
)
Expand Down Expand Up @@ -63,6 +65,8 @@ func main() {
})

// Listen and Server in 0.0.0.0:8080
router.Run()
if err := router.Run(); err != nil {
log.Fatal(err)
}
}
```
6 changes: 5 additions & 1 deletion example/code1/example.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"log"

"github.com/gin-contrib/secure"
"github.com/gin-gonic/gin"
)
Expand Down Expand Up @@ -28,5 +30,7 @@ func main() {
})

// Listen and Server in 0.0.0.0:8080
router.Run()
if err := router.Run(); err != nil {
log.Fatal(err)
}
}
6 changes: 5 additions & 1 deletion example/code2/example.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package main

import (
"log"

"github.com/gin-contrib/secure"
"github.com/gin-gonic/gin"
)
Expand All @@ -17,5 +19,7 @@ func main() {
c.String(200, "pong")
})

router.Run()
if err := router.Run(); err != nil {
log.Fatal(err)
}
}
0