From e31271951d199bda766d9b66d2805d09850e92b7 Mon Sep 17 00:00:00 2001 From: Kreedzt Date: Thu, 23 May 2024 09:48:28 +0800 Subject: [PATCH 1/2] :wrench: add sonar cloud ci --- .github/workflows/ci.yml | 15 +++++++++++++-- README.md | 6 +++--- sonar-project.properties | 2 ++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65c5723..018faa3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,23 @@ env: jobs: build: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 - name: Build run: cargo build --verbose - name: Run tests run: cargo test --verbose + + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/README.md b/README.md index cc2ee14..30e86df 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ![license](https://badgen.net/github/license/Kreedzt/rwr-profile-server) ![latest release](https://badgen.net/github/release/Kreedzt/rwr-profile-server) -![commits count](https://badgen.net/github/commits/Kreedzt/rwr-profile-server) -![last commit](https://badgen.net/github/last-commit/Kreedzt/rwr-profile-server) -![rwr_version](https://badgen.net/badge/RWR/1.94/orange) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Kreedzt_rwr-profile-server&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Kreedzt_rwr-profile-server) +[![Docker Image Size](https://badgen.net/docker/size/zhaozisong0/rwr-profile-server?icon=docker&label=image%20size)](https://hub.docker.com/r/zhaozisong0/rwr-profile-server) +![rwr_version](https://badgen.net/badge/RWR/1.97/orange) ## 开发 > 该项目提供了前端界面, 可用前端界面来进行开发调试: https://github.com/Kreedzt/rwr-profile-web diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..00af513 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,2 @@ +sonar.projectKey=Kreedzt_rwr-profile-server +sonar.organization=kreedzt From 0d8e8804628b64f8560fd39ccd5dcc31a6287c1e Mon Sep 17 00:00:00 2001 From: Kreedzt Date: Thu, 23 May 2024 09:56:09 +0800 Subject: [PATCH 2/2] :wrench: update ci --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 018faa3..f9f1204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: CI on: pull_request: branches: [master] + push: + branches: [master] permissions: contents: read