continuity/.gitea/workflows/server.yaml

46 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:
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
2023-10-27 18:29:06 +00:00
dotnet-version: 7.0
2023-10-27 17:52:19 +00:00
- run: |
2023-11-01 17:36:23 +00:00
dotnet build Continuity -c Release
# dotnet test Continuity.Tests -c Release
2023-10-27 19:14:10 +00:00
export SONAR_TOKEN=${{secrets.SONAR_TOKEN}}
export SONAR_PROJECT_KEY=${{secrets.SONAR_PROJECT_KEY}}
export SONAR_HOST_URL=${{secrets.SONAR_HOST_URL}}
export IS_LOCAL_BUILD=${{secrets.IS_LOCAL_BUILD}}
export SUPPORTS_DOCKER=${{secrets.SUPPORTS_DOCKER}}
2023-10-28 13:29:06 +00:00
apt-get update
2023-10-28 13:29:06 +00:00
apt-get install --yes openjdk-11-jre
2023-10-27 19:05:10 +00:00
chmod +x ./build.sh
2023-10-27 18:57:59 +00:00
./build.sh --verbose --root .
2023-11-01 17:36:23 +00:00
sonarqube:
needs: build-server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: https://github.com/actions/setup-dotnet@v3
with:
dotnet-version: 7.0
- run: |
apt-get update
apt-get install --yes openjdk-11-jre
dotnet tool install --global dotnet-sonarscanner
dotnet tool install --global dotnet-coverage
export PATH="$PATH:$HOME/.dotnet/tools"
dotnet sonarscanner begin /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
dotnet build"
# dotnet test --collect "Code Coverage" --logger trx --results-directory "TestsResults"
# dotnet-coverage collect 'dotnet test' -f xml -o 'coverage.xml'
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"