[Update] github actions to net7 #58
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test & SonarQube | |
on: | |
push: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: install VCD Generator | |
run: dotnet tool install --global vcdg | |
- name: Restore dependencies | |
run: dotnet restore VCD-Generator.sln | |
- name: Sonarqube Begin | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
dotnet tool install --global dotnet-sonarscanner | |
dotnet sonarscanner begin /k:"RHEAGROUP_VCD-Generator" /o:"rheagroup" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="./CoverageResults/coverage.opencover.xml" | |
- name: Build VCD-Generator | |
run: dotnet build VCD-Generator.sln --no-restore /p:ContinuousIntegrationBuild=true | |
- name: Run Tests and Compute Coverage | |
run: dotnet test VCD-Generator.sln --no-restore --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutput="../CoverageResults/" /p:MergeWith="../CoverageResults/coverage.json" /p:CoverletOutputFormat=\"opencover,json\" --logger:"nunit;LogFilePath=TestResults/{assembly}.Result.xml" -- NUnit.ShowInternalProperties=true | |
- name: Sonarqube end | |
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run VCD-Generator | |
run: vcdg -rf VCD-Generator.Tests/Data/Requirements-01.xlsx --requirements-sheet-name requirements --requirements-id-column Identifier --requirements-text-column "Requirement Text" --source-directory . --output-report vcd-report.xlsx | |
- name: Archive results | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vcd-report | |
path: vcd-report.xlsx |