From e2629f43ab6e8395e4e3886674901bb8668f3f20 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Wed, 23 Aug 2023 16:28:55 +0800 Subject: [PATCH] feat: add scripts test and format Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .github/workflows/e2e-test.yml | 30 ++++++++++++++++++++++++++++- .github/workflows/golangci-lint.yml | 4 ++-- .golangci.yml | 7 +++---- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index b9fa29aef..3358fc31a 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -12,5 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -# name: OpenIM e2e Test +name: e2e +on: + workflow_dispatch: + pull_request: + push: + schedule: + # run e2e test every 4 hours + - cron: 0 */4 * * * + +jobs: + build: + name: Test + runs-on: ubuntu-latest + env: + GO111MODULE: on + steps: + + - name: Set up Go 1.21 + uses: actions/setup-go@v2 + with: + go-version: 1.21 + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Create e2e test + run: | + echo "...test e2e" \ No newline at end of file diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7280a3d31..279d4bc35 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -26,13 +26,13 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: '1.21' + go-version: '1.20' cache: false - name: golangci-lint uses: golangci/golangci-lint-action@v3.7.0 with: # Require: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.54 + version: v1.53 # Optional: working directory, useful for monorepos # working-directory: server diff --git a/.golangci.yml b/.golangci.yml index ffeeb9c0a..2c7ab5348 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -58,7 +58,6 @@ run: skip-files: - ".*\\.my\\.go$" - _test.go - - ".*\\.pb\\.go" # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": # If invoked with -mod=readonly, the go command is disallowed from the implicit @@ -296,7 +295,7 @@ linters-settings: simplify: true gofumpt: - # Select the Go version to target. The default is `1.20`. + # Select the Go version to target. The default is `1.18`. lang-version: "1.20" # Choose whether or not to use the extra rules that are disabled @@ -584,13 +583,13 @@ linters-settings: severity: warning staticcheck: # Select the Go version to target. The default is '1.13'. - go: "1.20" + go: "1.16" # https://staticcheck.io/docs/options#checks checks: [ "all" ] stylecheck: # Select the Go version to target. The default is '1.13'. - go: "1.20" + go: "1.16" # https://staticcheck.io/docs/options#checks checks: [ "all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022" ]