-
Notifications
You must be signed in to change notification settings - Fork 115
135 lines (117 loc) · 5.05 KB
/
Codecov.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Codecov
on:
push:
branches:
- 'main'
workflow_dispatch:
jobs:
test:
name: codecov
runs-on: ubuntu-latest
strategy:
matrix:
redis-version: [5]
node: [16]
steps:
- name: git pull
uses: actions/checkout@v2
- name: run a one-line script
run: env
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Start Elasticsearch
uses: everpcpc/elasticsearch-action@v2
with:
version: 7.6.1
plugins: |
https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v7.6.1/elasticsearch-analysis-ik-7.6.1.zip
https://github.com/medcl/elasticsearch-analysis-pinyin/releases/download/v7.6.1/elasticsearch-analysis-pinyin-7.6.1.zip
analysis-icu
analysis-smartcn
analysis-kuromoji
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: ${{ matrix.redis-version }}
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.11
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- 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: SonarScanner for .NET 6 with pull request decoration support
# uses: highbyte/[email protected]
# with:
# # The key of the SonarQube project
# sonarProjectKey: masastack_MASA.Framework
# # The name of the SonarQube project
# sonarProjectName: MASA.Framework
# # The name of the SonarQube organization in SonarCloud. For hosted SonarQube, skip this setting.
# sonarOrganization: masastack
# # Optional command arguments to dotnet test
# dotnetTestArguments: --filter FullyQualifiedName!~Masa.Utils --no-build --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
# # Optional extra command arguments the the SonarScanner 'begin' command
# sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
#
#env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install SonarCloud scanner
run: |
dotnet tool install --global dotnet-sonarscanner
- name: setting dotnet version
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
8.0.x
7.0.x
6.0.x
include-prerelease: true
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet sonarscanner begin /k:"masastack_MASA.Framework" /o:"masastack" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build /p:ContinuousIntegrationBuild=true
# dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --verbosity normal --collect "Code Coverage" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- name: Opencover Test
run: |
dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"
- name: codecov
uses: codecov/[email protected]
# - name: Install SonarCloud scanner
# run: |
# dotnet tool install --global dotnet-sonarscanner
#
# - name: Build and analyze
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: |
# dotnet sonarscanner begin /k:"masastack_MASA.Framework" /o:"masastack" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
# dotnet build /p:ContinuousIntegrationBuild=true
# dotnet test --filter FullyQualifiedName!~Masa.Utils --no-build --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover /p:Exclude="[*.Tests]*"
# dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
#
# - name: codecov
# uses: codecov/codecov-action@v2