2021-04-27 01:41:32 +01:00
|
|
|
name: Build
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-04-30 17:01:01 +01:00
|
|
|
- main
|
2023-04-13 21:55:00 +01:00
|
|
|
workflow_dispatch:
|
2021-04-27 01:41:32 +01:00
|
|
|
pull_request:
|
|
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 1.11
|
2023-03-28 15:02:09 +01:00
|
|
|
- uses: actions/checkout@v3
|
2021-04-27 01:41:32 +01:00
|
|
|
with:
|
2024-02-12 01:46:16 +00:00
|
|
|
fetch-depth: 0
|
|
|
|
|
2021-04-27 01:41:32 +01:00
|
|
|
- name: Cache SonarCloud packages
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: ~\sonar\cache
|
|
|
|
key: ${{ runner.os }}-sonar
|
|
|
|
restore-keys: ${{ runner.os }}-sonar
|
|
|
|
- name: Cache SonarCloud scanner
|
|
|
|
id: cache-sonar-scanner
|
|
|
|
uses: actions/cache@v1
|
|
|
|
with:
|
|
|
|
path: .\.sonar\scanner
|
|
|
|
key: ${{ runner.os }}-sonar-scanner
|
|
|
|
restore-keys: ${{ runner.os }}-sonar-scanner
|
|
|
|
- name: Install SonarCloud scanner
|
|
|
|
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
|
|
|
|
shell: powershell
|
|
|
|
run: |
|
|
|
|
New-Item -Path .\.sonar\scanner -ItemType Directory
|
|
|
|
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
|
|
|
|
- name: Build and analyze
|
|
|
|
env:
|
2024-02-12 01:46:16 +00:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-27 01:41:32 +01:00
|
|
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
|
|
|
shell: powershell
|
|
|
|
run: |
|
2024-02-12 01:46:16 +00:00
|
|
|
.\.sonar\scanner\dotnet-sonarscanner begin /k:"X10D" /o:"oliverbooth" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
|
2022-04-20 22:53:32 +01:00
|
|
|
dotnet build --no-incremental
|
2022-04-20 23:00:33 +01:00
|
|
|
dotnet dotcover test --dcReportType=HTML
|
2021-04-27 01:41:32 +01:00
|
|
|
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
|