From 4af8f274ff8bf255cdf9f05ec570d09398f39153 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Wed, 26 Jul 2023 15:33:43 +0800 Subject: [PATCH] feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- .github/workflows/codeql-analysis.yml | 16 +++---- .github/workflows/pull-request.yml | 67 +++++++++++++++++++++++---- 2 files changed, 65 insertions(+), 18 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6233ffcad..a76979ab9 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,7 +13,7 @@ # limitations under the License. -name: "Code Scanning - Action" +name: "OpenIM Code Scanning - Action" on: push: @@ -42,8 +42,8 @@ jobs: security-events: write # only required for workflows in private repositories - actions: read - contents: read + actions: write + contents: write steps: - name: Checkout repository @@ -53,8 +53,8 @@ jobs: - name: Initialize CodeQL uses: github/codeql-action/init@v2 # Override language selection by uncommenting this and choosing your languages - # with: - # languages: go, javascript, csharp, python, cpp, java, ruby + with: + languages: go # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below). @@ -68,9 +68,9 @@ jobs: # three lines and modify them (or add more) to build your code if your # project uses a compiled language - #- run: | - # make bootstrap - # make release + # - run: | + # make bootstrap + # make release - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 \ No newline at end of file diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 29dbad788..c6c577817 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -37,16 +37,63 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + - name: Setup Go + uses: actions/setup-go@v2 + - name: Run go modules tidy + run: | + sudo make tidy + sudo make tools.verify.go-gitlint + echo "Run go modules tidy successfully" + + - name: Run go format + run: | + sudo make format + echo "Run go format successfully" + continue-on-error: true + + - name: Generate all necessary files, such as error code files + run: | + make generate + echo "Generate all necessary files successfully" + continue-on-error: true + + - name: Run unit test and get test coverage + run: | + make cover + echo "Run unit test and get test coverage successfully" + continue-on-error: true + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 with: - token: ${{ secrets.REDBOT_GITHUB_TOKEN }} - commit-message: 'build: update distribution' - title: 'build: update distribution' - body: | - - Updates the distribution for changes on `main` + languages: go - Auto-generated by [create-pull-request][1] + - name: Build source code for host platform + run: | + sudo make build + echo "Build source code for host platform successfully" - [1]: https://github.com/OpenIMSDK/Open-IM-Sever - branch: 'bot/update-distribution' \ No newline at end of file + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + + - name: OpenIM verify copyright + run: | + sudo make verify-copyright + sudo make add-copyright + echo "OpenIM verify successfully" + continue-on-error: true + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5.0.0 + with: + commit-message: Bump League Patch to ${{ steps.patch.outputs.patch }} + title: Bump League Patch to ${{ steps.patch.outputs.patch }} + body: | + Review criteria: + + - [ ] Disenchanter can connect and issue actions + + This is an automated PR. + [workflow](https://github.com/OpenIMSDK/Open-IM-Server/blob/main/.github/workflows/pull-request.yml). + branch: cicd/patch-${{ steps.patch.outputs.patch }} + labels: kind/documentation, area/test, ok-to-test \ No newline at end of file