feat: add scripts test and format

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/921/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 737e797109
commit f1695f3b35
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE

@ -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

@ -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 <kubbot@3293172751ysy@gmail.com>
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 }}
<sub>[workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/.github/workflows/pull-request.yml).</sub>
base: main
branch: cicd/patch-${{ github.event.number }}

Loading…
Cancel
Save