-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
33 lines (28 loc) · 940 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
image: mcr.microsoft.com/dotnet/sdk:6.0-bookworm-slim
stages:
- test
- build
- analyze
unit test:
stage: test
script:
- dotnet test
build:
stage: build
script:
- dotnet build --output ./build/ ./Battleship.Ascii/Battleship.Ascii.csproj
# - dotnet publish -r win10-x64 --output ./build/ ./Battleship.Ascii/Battleship.Ascii.csproj => Uncomment and adapt if you want to create a platform-dependent build for your operating system
artifacts:
paths:
- ./build/
sonar:
stage: analyze
before_script:
- dotnet tool install --global dotnet-sonarscanner
- export PATH="$PATH:/root/.dotnet/tools"
- mkdir -p /usr/share/man/man1/
- apt-get update && apt-get install -y default-jdk
script:
- dotnet sonarscanner begin /k:"$$$SONAR_PROJECT_KEY$$$" /d:sonar.host.url=$$$SONAR_URL$$$ /d:sonar.login=$$$SONAR_LOGIN$$$
- dotnet build
- dotnet sonarscanner end /d:sonar.login=$$$SONAR_LOGIN$$$