continuity/.gitea/workflows/server.yaml

50 lines
1.7 KiB
YAML
Raw Normal View History

2023-08-13 16:34:10 +00:00
name: Test if Server can be built
run-name: ${{ gitea.actor }} is building the Server application
2023-08-13 16:52:46 +00:00
on: [ push ]
2023-08-13 16:34:10 +00:00
jobs:
build-server:
2023-11-01 17:42:49 +00:00
runs-on: ubuntu-latest
2023-08-13 16:34:10 +00:00
steps:
2023-11-01 17:42:49 +00:00
- uses: actions/checkout@v3
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
dotnet-version: 7.0
2023-11-01 17:48:39 +00:00
- name: Install dependencies
run: dotnet restore
- name: Build
run: |
2023-11-01 17:49:45 +00:00
dotnet build Server -c Release
# dotnet test Server.Tests -c Release
2023-11-01 17:36:23 +00:00
sonarqube:
needs: build-server
runs-on: ubuntu-latest
2023-11-01 17:45:14 +00:00
if: gitea.ref == 'refs/heads/master'
2023-11-01 17:36:23 +00:00
steps:
2023-11-01 17:42:49 +00:00
- uses: actions/checkout@v3
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
dotnet-version: 7.0
- name: Install dependencies
run: dotnet restore
- name: Setup Sonarqube Dependencies
run: |
apt-get update
apt-get install --yes openjdk-11-jre
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-coverage
2023-11-01 17:57:46 +00:00
export PATH="$PATH:/root/.dotnet/tools"
2023-11-01 17:42:49 +00:00
- 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: |
2023-11-01 17:49:45 +00:00
dotnet build Server -c Release
2023-11-01 17:42:49 +00:00
# dotnet test --collect "Code Coverage" --logger trx --results-directory "TestsResults"
# dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
- name: Sonarqube End
run: |
2023-11-01 17:36:23 +00:00
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"