Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sonar #1

Open
wants to merge 23 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/sonarqube.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
pull_request:
types: [opened, synchronize, reopened]

name: PR Static Code Analysis
jobs:
static-code-analysis:
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0'
- name: Create temporary global.json
run: echo '{"sdk":{"version":"7.0.x"}}' > ./global.json
- name: Install protobuf
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarQube scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: ./.sonar/scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarScanner for .NET
run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
- name: Add .NET global tools to PATH
run: echo "$HOME/.dotnet/tools" >> $GITHUB_PATH
- name: Begin SonarQube analysis
run: |
./.sonar/scanner/dotnet-sonarscanner begin /k:"forest-contract" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet build
./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
1 change: 0 additions & 1 deletion contract/Forest/Forest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
<Link>Protobuf\Proto\authority_info.proto</Link>
</CommonMessage>
</ItemGroup>

<ItemGroup>
<ContractReference Include="..\..\protobuf\acs12.proto">
<Link>Protobuf\Proto\reference\acs12.proto</Link>
Expand Down
Loading