ci: steps

This commit is contained in:
Timothy Schenk 2023-11-01 18:39:59 +01:00
parent 7b4fb55727
commit a7fddf6c02

View file

@ -10,7 +10,7 @@ jobs:
uses: https://github.com/actions/setup-dotnet@v3 uses: https://github.com/actions/setup-dotnet@v3
with: with:
dotnet-version: 7.0 dotnet-version: 7.0
- run: | run: |
dotnet build Continuity -c Release dotnet build Continuity -c Release
# dotnet test Continuity.Tests -c Release # dotnet test Continuity.Tests -c Release
export SONAR_TOKEN=${{secrets.SONAR_TOKEN}} export SONAR_TOKEN=${{secrets.SONAR_TOKEN}}
@ -22,7 +22,6 @@ jobs:
apt-get install --yes openjdk-11-jre apt-get install --yes openjdk-11-jre
chmod +x ./build.sh chmod +x ./build.sh
./build.sh --verbose --root . ./build.sh --verbose --root .
sonarqube: sonarqube:
needs: build-server needs: build-server
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -32,14 +31,24 @@ jobs:
uses: https://github.com/actions/setup-dotnet@v3 uses: https://github.com/actions/setup-dotnet@v3
with: with:
dotnet-version: 7.0 dotnet-version: 7.0
- run: | - name: Install dependencies
apt-get update run: dotnet restore
apt-get install --yes openjdk-11-jre - name: Setup Sonarqube Dependencies
dotnet tool install --global dotnet-sonarscanner run: |
dotnet tool install --global dotnet-coverage apt-get update
export PATH="$PATH:$HOME/.dotnet/tools" apt-get install --yes openjdk-11-jre
dotnet sonarscanner begin /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" dotnet tool install --global dotnet-sonarscanner
dotnet build" dotnet tool install --global dotnet-coverage
export PATH="$PATH:$HOME/.dotnet/tools"
- name: Sonarqube Begin
run: |
dotnet sonarscanner begin /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
- name: Sonarqube Scan
run: |
dotnet build
# dotnet test --collect "Code Coverage" --logger trx --results-directory "TestsResults" # dotnet test --collect "Code Coverage" --logger trx --results-directory "TestsResults"
# dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml' # dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
- name: Sonarqube End
run: |
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"