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: push:
branches: [main] branches: [main]
pull_request: pull_request:
branches: [main]
jobs: jobs:
golangci: golangci:
name: lint name: lint
@ -30,7 +29,7 @@ jobs:
go-version: '1.21' go-version: '1.21'
cache: false cache: false
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v3 uses: golangci/golangci-lint-action@v3.7.0
with: with:
# Require: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version # 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 version: v1.53
@ -42,7 +41,7 @@ jobs:
# #
# Note: by default the `.golangci.yml` file should be at the root of the repository. # 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=` # 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`. # Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true only-new-issues: true

@ -60,6 +60,12 @@ jobs:
echo "Run go format successfully" echo "Run go format successfully"
continue-on-error: true 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 - name: Generate all necessary files, such as error code files
run: | run: |
make generate make generate
@ -72,18 +78,13 @@ jobs:
echo "Run unit test and get test coverage successfully" echo "Run unit test and get test coverage successfully"
continue-on-error: true continue-on-error: true
- name: Initialize CodeQL # - name: Initialize CodeQL
uses: github/codeql-action/init@v2 # uses: github/codeql-action/init@v2
with: # with:
languages: go # languages: go
- name: Build source code for host platform
run: |
sudo make build
echo "Build source code for host platform successfully"
- name: Perform CodeQL Analysis # - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2 # uses: github/codeql-action/analyze@v2
- name: OpenIM verify copyright - name: OpenIM verify copyright
run: | run: |
@ -100,21 +101,21 @@ jobs:
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v5 uses: peter-evans/create-pull-request@v5
with: with:
token: ${{ secrets.REDBOT_GITHUB_TOKEN }} token: ${{ secrets.BOT_GITHUB_TOKEN }}
commit-message: "cicd: bump League Patch to cicd/patch-${{ github.event.number }}" commit-message: "cicd: bump League Patch to cicd/patch-${{ github.event.number }}"
title: 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 signoff: false
draft: false draft: false
# assignees: ${{ github.actor }} assignees: cubxxw
# reviewers: ${{ github.actor }} reviewers: cubxxw
delete-branch: true delete-branch: true
body: | body: |
Review criteria: Review criteria:
- [ ] Disenchanter can connect and issue actions - [ ] 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> <sub>[workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/.github/workflows/pull-request.yml).</sub>
base: main base: main
branch: cicd/patch-${{ github.event.number }} branch: cicd/patch-${{ github.event.number }}

Loading…
Cancel
Save