Skip to content

Commit

Permalink
chore: add lint and test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
NgoKimPhu committed Nov 8, 2023
1 parent dbe00fa commit 3339c4d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

<!--- Provide a general summary of your changes in the Title above -->

## Why did we need it?
<!--- Describe your changes in detail -->

## Related Issue
<!--- This project only accepts pull requests related to open issues -->
<!--- If suggesting a new feature or change, please discuss it in an issue first -->
<!--- If fixing a bug, there should be an issue describing it with steps to reproduce -->
<!--- Please link to the issue here: -->

## Release Note
<!--- Please list out special notes (if any) when releasing this commit -->
<!--- Special notes is things like breaking changes and related components, required changes and env configurations in kyber-application, etc. -->

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'CI'

concurrency:
group: ci-workflow-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true

permissions: write-all

on:
workflow_dispatch:
push:
branches:
- 'develop'
- 'main'
pull_request:

jobs:
ci:
uses: KyberNetwork/service-framework/.github/workflows/ci.yaml@main
secrets: inherit
1 change: 1 addition & 0 deletions ctx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
)

func TestCtxWithoutCancel(t *testing.T) {
// nolint:staticcheck
cancelledCtx, cancel := context.WithTimeout(
context.WithValue(CtxWithoutCancel(nil), "key", "value"), time.Second)
detachedCtx := CtxWithoutCancel(cancelledCtx)
Expand Down
4 changes: 2 additions & 2 deletions http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func TestHttpCfg_NewRestyClient(t *testing.T) {
&HttpCfg{
HttpClient: http.DefaultClient,
BaseUrl: "base",
Headers: map[string][]string{"header": {"value"}},
Headers: map[string][]string{"Header": {"value"}},
RetryCount: 1,
RetryWaitTime: time.Millisecond,
RetryMaxWaitTime: time.Second,
Expand All @@ -34,7 +34,7 @@ func TestHttpCfg_NewRestyClient(t *testing.T) {
assert.NotNil(t, c)
assert.Equal(t, http.DefaultClient, c.GetClient())
assert.Equal(t, "base", c.BaseURL)
assert.Equal(t, []string{"value"}, c.Header["header"])
assert.Equal(t, []string{"value"}, c.Header["Header"])
assert.Equal(t, 1, c.RetryCount)
assert.Equal(t, time.Millisecond, c.RetryWaitTime)
assert.Equal(t, time.Second, c.RetryMaxWaitTime)
Expand Down

0 comments on commit 3339c4d

Please sign in to comment.