Skip to content

Commit

Permalink
Updated variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Farshad DASHTI authored and Farshad DASHTI committed Oct 4, 2024
1 parent 3303a3f commit 9917280
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-test-asyncprocessing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
project_name: DfE.CoreLibs.AsyncProcessing
project_path: src/DfE.CoreLibs.AsyncProcessing
sonar_project_key: DFE-Digital_corelibs-asyncprocessing
secrets:
GITHUB__TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR__TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/build-test-caching.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
project_name: DfE.CoreLibs.Caching
project_path: src/DfE.CoreLibs.Caching
sonar_project_key: DFE-Digital_corelibs-caching
secrets:
GITHUB__TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR__TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/build-test-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
project_name: DfE.CoreLibs.Contracts
project_path: src/DfE.CoreLibs.Contracts
sonar_project_key: DFE-Digital_corelibs-contracts
secrets:
GITHUB__TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR__TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/build-test-http.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
project_name: DfE.CoreLibs.Http
project_path: src/DfE.CoreLibs.Http
sonar_project_key: DFE-Digital_corelibs-http
secrets:
GITHUB__TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR__TOKEN: ${{ secrets.SONAR_TOKEN }}
16 changes: 10 additions & 6 deletions .github/workflows/build-test-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ on:
required: true
type: string
description: "SonarCloud project key"

secrets:
GITHUB__TOKEN:
required: true
SONAR__TOKEN:
required: true
env:
DOTNET_VERSION: '8.0.x'
EF_VERSION: '6.0.5'
Expand Down Expand Up @@ -61,20 +65,20 @@ jobs:
run: dotnet tool install --global dotnet-reportgenerator-globaltool

- name: Add nuget package source
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/DFE-Digital/index.json"
run: dotnet nuget add source --username USERNAME --password ${{ secrets.GITHUB__TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/DFE-Digital/index.json"

- name: Restore dependencies
run: dotnet restore ${{ inputs.project_path }}

- name: Build, Test and Analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB__TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR__TOKEN }}
ConnectionStrings__DefaultConnection: ${{ env.CONNECTION_STRING }}
CI: true
run: |
dotnet-sonarscanner begin /k:"${{ inputs.sonar_project_key }}" /o:"dfe-digital" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml
dotnet-sonarscanner begin /k:"${{ inputs.sonar_project_key }}" /o:"dfe-digital" /d:sonar.token="${{ secrets.SONAR__TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverageReportPaths=CoverageReport/SonarQube.xml
dotnet build --no-restore -p:CI=${CI} ${{ inputs.project_path }}
dotnet test --no-build --verbosity normal --collect:"XPlat Code Coverage" ${{ inputs.project_path }}
reportgenerator -reports:./**/coverage.cobertura.xml -targetdir:./CoverageReport -reporttypes:SonarQube
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR__TOKEN }}"
3 changes: 3 additions & 0 deletions .github/workflows/build-test-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
project_name: DfE.CoreLibs.Testing
project_path: src/DfE.CoreLibs.Testing
sonar_project_key: DFE-Digital_corelibs-testing
secrets:
GITHUB__TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR__TOKEN: ${{ secrets.SONAR_TOKEN }}
3 changes: 3 additions & 0 deletions .github/workflows/build-test-utilities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ jobs:
project_name: DfE.CoreLibs.Utilities
project_path: src/DfE.CoreLibs.Utilities
sonar_project_key: DFE-Digital_corelibs-utilities
secrets:
GITHUB__TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR__TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 9917280

Please sign in to comment.