MapMethods 虚拟化,以便重写构建管道实现 (#707) #512
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |