forked from hubspot-net/HubSpot.NET
-
Notifications
You must be signed in to change notification settings - Fork 5
46 lines (34 loc) · 1.47 KB
/
test.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
39
40
41
42
43
44
45
name: Run Tests
# Triggers the workflow on push or pull request events
on: [push]
jobs:
# Label of the container job
test_platform:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
env:
BUILD_CONFIGURATION: Release
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.x.x
- name: Sonarqube Begin
if: github.ref == 'refs/heads/production'
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /o:boomandbucket /k:hubspot_net /v:$GITHUB_RUN_NUMBER /d:sonar.login=${{ secrets.SONAR_TOKEN }} /s:$GITHUB_WORKSPACE/SonarQube.Analysis.xml
- name: Sonarqube Begin
if: github.ref != 'refs/heads/production'
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin /o:boomandbucket /k:hubspot_net /d:sonar.login=${{ secrets.SONAR_TOKEN }} /s:$GITHUB_WORKSPACE/SonarQube.Analysis.xml
- name: Test
run: dotnet test ./HubSpot.NETCore.sln --verbosity normal -r ./test-results --logger "GitHubActions;" --logger "trx;LogFilePath=./TestResults/test_result.trx" --collect:"XPlat Code Coverage" --settings $GITHUB_WORKSPACE/coverlet.runsettings
- name: Sonarqube end
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}