casbin / Casbin.NET

An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
https://casbin.org
Apache License 2.0
1.16k stars 111 forks source link

ci: Setup SonarCloud Analysis #221

Closed Leonardo-Ferreira closed 2 years ago

Leonardo-Ferreira commented 2 years ago

This pull request enables the analysis of the project by sonarcloud.

The reports will be accessible at https://sonarcloud.io/organizations/casbin/projects

A preview of the result can be seen here: https://sonarcloud.io/organizations/leonardo-ferreira/projects

casbin-bot commented 2 years ago

@sagilio @xcaptain @huazhikui please review

Leonardo-Ferreira commented 2 years ago

@hsluoyz the build is failing with a empty sonar key image Idk exactly why though... either you entered the key in the wrong place, or actions triggered by me aren't allowed to read it... Can you help?

Leonardo-Ferreira commented 2 years ago

@sagilio because the pipeline already runs tests, and all im doing is basically "wrapping" it with sonar begin/end I thought it wouldn't be a matter, specially because in the future we can use sonar quality gates to prevent things that hurt the project (bug introduction, test coverage drop, tech debt) to be introduced, and block the PR! Would you still want to separate the workflows?

Leonardo-Ferreira commented 2 years ago

@hsluoyz please create 2 secrets: SONAR_PROJECT_KEY = casbin_Casbin.NET SONAR_CASBIN_ORG_NAME = casbin

hsluoyz commented 2 years ago

@Leonardo-Ferreira we can try separated workflows first. Done:

image

Leonardo-Ferreira commented 2 years ago

image @huazhikui I broke up the workflows but I think we are back to the previously mentioned issue: either values are empty or my workflow can't/not-allowed-to read them...

hsluoyz commented 2 years ago

@Leonardo-Ferreira plz merge the commits into 1 or 2, 23 commits are too many for such a PR..

sagilio commented 2 years ago

PR can not read the secret when using GitHub Actions, we can merge it first.

hsluoyz commented 2 years ago

Replaced by: https://github.com/casbin/Casbin.NET/pull/223