From e7fe46ab1830154eceb1fe41908f71c938e982b4 Mon Sep 17 00:00:00 2001 From: Serene Aronow Date: Wed, 16 Apr 2025 14:36:40 -0400 Subject: [PATCH] Added initial yaml from sonarQube and gitignored vscode folder --- .github/workflows/build.yaml | 47 ++++++++++++++++++++++++++++++++++++ .gitignore | 3 +++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..164ca41 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,47 @@ +name: SonarQube +on: + push: + branches: + - main + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build and analyze + runs-on: windows-latest + steps: + - name: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: 17 + distribution: 'zulu' # Alternative distribution options are available. + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Cache SonarQube Cloud packages + uses: actions/cache@v4 + with: + path: ~\sonar\cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache SonarQube Cloud scanner + id: cache-sonar-scanner + uses: actions/cache@v4 + with: + path: .\.sonar\scanner + key: ${{ runner.os }}-sonar-scanner + restore-keys: ${{ runner.os }}-sonar-scanner + - name: Install SonarQube Cloud scanner + if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' + shell: powershell + run: | + New-Item -Path .\.sonar\scanner -ItemType Directory + dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + shell: powershell + run: | + .\.sonar\scanner\dotnet-sonarscanner begin /k:"8thlight_8lpets" /o:"8thlight" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" + dotnet build + .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ No newline at end of file diff --git a/.gitignore b/.gitignore index ce1227d..f715cb9 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,6 @@ CodeCoverage/ *.VisualState.xml TestResult.xml nunit-*.xml + +# VS Code +.vscode/* \ No newline at end of file