diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 4751cc9..209d618 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -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: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 73b8964..5d79583 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 83c49d9..a506286 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/context.go b/context.go index 18d6cf2..c4b2149 100644 --- a/context.go +++ b/context.go @@ -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) }