forked from openimsdk/openkf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
298 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,62 @@ | ||
# Copyright © 2023 OpenIMSDK open source community. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
name: "Code Scanning - Action" | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [main] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: "*" | ||
# schedule: | ||
# - cron: '23 2 * * 2' | ||
branches: [main] | ||
schedule: | ||
# ┌───────────── minute (0 - 59) | ||
# │ ┌───────────── hour (0 - 23) | ||
# │ │ ┌───────────── day of the month (1 - 31) | ||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC) | ||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT) | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# │ │ │ │ │ | ||
# * * * * * | ||
- cron: '30 1 * * 0' | ||
|
||
jobs: | ||
# analyze: | ||
# name: Analyze | ||
# runs-on: ubuntu-latest | ||
# permissions: | ||
# actions: read | ||
# contents: read | ||
# security-events: write | ||
|
||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# language: [ 'go' ] | ||
# # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# # Learn more: | ||
# # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
|
||
# steps: | ||
# - name: Checkout repository | ||
# uses: actions/checkout@v2 | ||
|
||
# # Initializes the CodeQL tools for scanning. | ||
# - name: Initialize CodeQL | ||
# uses: github/codeql-action/init@v1 | ||
# with: | ||
# languages: ${{ matrix.language }} | ||
# # If you wish to specify custom queries, you can do so here or in a config file. | ||
# # By default, queries listed here will override any specified in a config file. | ||
# # Prefix the list here with "+" to use these queries and those in the config file. | ||
# # queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# # If this step fails, then you should remove it and run the build manually (see below) | ||
# - name: Autobuild | ||
# uses: github/codeql-action/autobuild@v1 | ||
|
||
# # ℹ️ Command-line programs to run using the OS shell. | ||
# # 📚 https://git.io/JvXDl | ||
|
||
# # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# # and modify them (or add more) to build your code if your project | ||
# # uses a compiled language | ||
|
||
# #- run: | | ||
# # make bootstrap | ||
# # make release | ||
|
||
# - name: Perform CodeQL Analysis | ||
# uses: github/codeql-action/analyze@v1 | ||
CodeQL-Build: | ||
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# required for all workflows | ||
security-events: write | ||
|
||
# only required for workflows in private repositories | ||
actions: read | ||
contents: read | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- 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 | ||
|
||
# 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). | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following | ||
# three lines and modify them (or add more) to build your code if your | ||
# project uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright 2020 Lingfei Kong <colin404@foxmail.com>. All rights reserved. | ||
# Use of this source code is governed by a MIT style | ||
# license that can be found in the LICENSE file. | ||
|
||
name: OpenKF golangci-lint | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
cache: false | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
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 | ||
|
||
# Optional: working directory, useful for monorepos | ||
working-directory: server | ||
|
||
# Optional: golangci-lint command line arguments. | ||
# | ||
# 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: --timeout=30m --config=/my/path/.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 | ||
|
||
# Optional:The mode to install golangci-lint. It can be 'binary' or 'goinstall'. | ||
install-mode: "goinstall" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: OpenKF CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: [opened, reopened] | ||
|
||
jobs: | ||
openkf: | ||
name: Test with go ${{ matrix.go_version }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
environment: | ||
name: openkf | ||
|
||
strategy: | ||
matrix: | ||
go_version: [1.18] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Set up Go ${{ matrix.go_version }} | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go_version }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run go modules tidy | ||
run: | | ||
make tidy | ||
- name: Generate all necessary files, such as error code files | ||
run: | | ||
make generate | ||
- name: Check syntax and styling of go sources | ||
run: | | ||
set -e | ||
make lint | ||
- name: Run unit test and get test coverage | ||
run: | | ||
make cover | ||
- name: Build source code for host platform | ||
run: | | ||
make build | ||
- name: Collect Test Coverage File | ||
uses: actions/upload-artifact@v1.0.0 | ||
with: | ||
name: main-output | ||
path: _output/tmp/coverage.out | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ env.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build docker images for host arch and push images to registry | ||
run: | | ||
set -e | ||
make docker-push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.