Skip to content

Commit

Permalink
feat: optimize ci
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Aug 21, 2024
1 parent a99e164 commit 868bfc7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Install dependencies
run: go mod tidy
- name: Run tests with coverage
run: go test -v -coverprofile="coverage.out" ./...
run: go test -timeout 1h -coverprofile="coverage.out" ./...
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
24 changes: 2 additions & 22 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,5 @@ permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 'stable'
cache: false
- name: go mod pakcage cache
uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('go.mod') }}
- name: Install dependencies
run: go mod tidy
- name: Lint
uses: golangci/golangci-lint-action@v6
with:
skip-cache: true
skip-pkg-cache: true
skip-build-cache: true
version: latest
args: --timeout=30m ./...
uses: goravel/.github/.github/workflows/lint.yml@master
secrets: inherit
31 changes: 3 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,6 @@ on:
- master
pull_request:
jobs:
ubuntu:
strategy:
matrix:
go: [ "1.21", "1.22" ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: go mod tidy
- name: Run tests
run: go test ./...
windows:
strategy:
matrix:
go: [ "1.21", "1.22" ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install dependencies
run: go mod tidy
- name: Run tests
run: go test ./... -short
test:
uses: goravel/.github/.github/workflows/test.yml@master
secrets: inherit
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (c *Context) Response() http.ContextResponse {
}

func (c *Context) WithValue(key string, value any) {
ctx := context.WithValue(c.instance.UserContext(), key, value)
ctx := context.WithValue(c.instance.UserContext(), key, value) //nolint:staticcheck
c.instance.SetUserContext(ctx)
}

Expand Down

0 comments on commit 868bfc7

Please sign in to comment.