From 3317cc8e597263ebfe19988293b5d0d6f150369f Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw)" <3293172751nss@gmail.com> Date: Sat, 13 May 2023 20:17:43 +0800 Subject: [PATCH] styles: add common make cover Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com> --- .github/workflows/link-pr.yml | 45 +++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 4 ++-- script/make-rules/common.mk | 1 + 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/link-pr.yml diff --git a/.github/workflows/link-pr.yml b/.github/workflows/link-pr.yml new file mode 100644 index 000000000..0f2a735b2 --- /dev/null +++ b/.github/workflows/link-pr.yml @@ -0,0 +1,45 @@ +name: links when pr + +on: + pull_request: + branches: [ main ] + paths: + - '**.md' + - 'docs/**' + - '.lycheeignore' + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set Node.js 16.x + uses: actions/setup-node@v3 + with: + node-version: 16.x + - name: Run Install + working-directory: docs + run: npm install + - name: Run build + uses: borales/actions-yarn@v4 + with: + cmd: build # will run `yarn build` command in `docs` directory + dir: docs + - name: Link Checker + uses: lycheeverse/lychee-action@v1.5.0 + with: + fail: true + # For parameter description, see https://github.com/lycheeverse/lychee#commandline-parameters + # -E, --exclude-all-private Exclude all private IPs from checking. + # -i, --insecure Proceed for server connections considered insecure (invalid TLS) + # -n, --no-progress Do not show progress bar. + # -t, --timeout Website timeout in seconds from connect to response finished [default:20] + # --max-concurrency Maximum number of concurrent network requests [default: 128] + # -a --accept Comma-separated list of accepted status codes for valid links + + # docs/.vitepress/dist the site directory to check + # ./*.md all markdown files in the root directory + args: -E -i -n -t 45 --max-concurrency 64 -a 429,401 -- 'docs/.vitepress/dist' '*.md' + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1d0f3e9e..28a266a8e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -342,7 +342,7 @@ These two kind of tests: `lint` and `unit test` > You can use the [Makefile](./Makefile) to run Lint with the command `make lint`. -`unit test` runs all the test in code, and the code coverage should not less than 60 percent, record us in [codeclimate](https://codeclimate.com/github/OpenIMSDK/Open-IM-Server) OpenIM the unit test coverage data. +`unit test` runs all the test in code, and the code coverage should not less than 60 percent, record us in [codeclimate](https://codeclimate.com/github.com/OpenIMSDK/Open-IM-Server) OpenIM the unit test coverage data. > **Note** @@ -385,7 +385,7 @@ We choose GitHub as the primary place for OpenIM to collaborate. So the latest u + help solve other user's problems; + help review other's [PR](https://github.com/OpenIMSDK/Open-IM-Server/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) design; + discuss about OpenIM to make things clearer; -+ advocate [OpenIM](google.com/search?q=OpenIM) technology beyond GitHub; ++ advocate [OpenIM](https://google.com/search?q=OpenIM) technology beyond GitHub; + write blogs on OpenIM and so on. In a word, **ANY HELP IS CONTRIBUTION.** diff --git a/script/make-rules/common.mk b/script/make-rules/common.mk index 9da3d381b..97596b95e 100644 --- a/script/make-rules/common.mk +++ b/script/make-rules/common.mk @@ -70,6 +70,7 @@ endif GIT_COMMIT:=$(shell git rev-parse HEAD) # Minimum test coverage +# can u use make cover COVERAGE=90 ifeq ($(origin COVERAGE),undefined) COVERAGE := 60 endif