From f1695f3b35c332c3bb5b64feba9cd03e8595d19e Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Wed, 23 Aug 2023 15:45:57 +0800 Subject: [PATCH] feat: add scripts test and format Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .github/workflows/golangci-lint.yml | 5 ++--- .github/workflows/pull-request.yml | 35 +++++++++++++++-------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8cc1fe73b..815baab4c 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -18,7 +18,6 @@ on: push: branches: [main] pull_request: - branches: [main] jobs: golangci: name: lint @@ -30,7 +29,7 @@ jobs: go-version: '1.21' cache: false - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + 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.53 @@ -42,7 +41,7 @@ jobs: # # Note: by default the `.golangci.yml` file should be at the root of the repository. # The location of the configuration file can be changed by using `--config=` - args: -c ./scripts/golangci.yml --timeout=30m # --issues-exit-code=0 + args: --timeout=30m --config=/scripts/golangci.yml --issues-exit-code=0 # Optional: show only new issues if it's a pull request. The default value is `false`. only-new-issues: true diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 92f8ba990..dc683e49b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -60,6 +60,12 @@ jobs: echo "Run go format successfully" continue-on-error: true + - name: Run go lint + run: | + sudo make lint + echo "Run go lint successfully" + continue-on-error: true + - name: Generate all necessary files, such as error code files run: | make generate @@ -72,18 +78,13 @@ jobs: echo "Run unit test and get test coverage successfully" continue-on-error: true - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: go - - - name: Build source code for host platform - run: | - sudo make build - echo "Build source code for host platform successfully" + # - name: Initialize CodeQL + # uses: github/codeql-action/init@v2 + # with: + # languages: go - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + # - name: Perform CodeQL Analysis + # uses: github/codeql-action/analyze@v2 - name: OpenIM verify copyright run: | @@ -100,21 +101,21 @@ jobs: - name: Create Pull Request uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.REDBOT_GITHUB_TOKEN }} + token: ${{ secrets.BOT_GITHUB_TOKEN }} commit-message: "cicd: bump League Patch to cicd/patch-${{ github.event.number }}" title: Bump League Patch to cicd/patch-${{ github.event.number }} - author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + author: kubbot signoff: false draft: false - # assignees: ${{ github.actor }} - # reviewers: ${{ github.actor }} + assignees: cubxxw + reviewers: cubxxw delete-branch: true body: | Review criteria: - + - [ ] Disenchanter can connect and issue actions - This is an automated PR. + This is an automated PR. @ ${{ github.actor }} [workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/.github/workflows/pull-request.yml). base: main branch: cicd/patch-${{ github.event.number }}