-
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1.16 KB
/
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
33
34
35
36
37
38
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
DOTNET_ROLL_FORWARD: Major
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.100
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
- name: Restore tools
run: dotnet tool restore
- name: Begin scan
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != ''
run: dotnet sonarscanner begin /o:"kaliumhexacyanoferrat" /k:"Kaliumhexacyanoferrat_GenHTTP.Templates" /d:sonar.token="$SONAR_TOKEN" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.branch.name="${GITHUB_REF##*/}"
- name: Build project
run: dotnet build GenHTTP.Templates.csproj -c Release
- name: End scan
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != ''
run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN"