-
Notifications
You must be signed in to change notification settings - Fork 638
145 lines (132 loc) · 6.33 KB
/
Lucene-Net-Tests-AllProjects.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
136
137
138
139
140
141
142
143
144
####################################################################################
# DO NOT EDIT: This file was automatically generated by Generate-TestWorkflows.ps1
####################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: 'Lucene.Net.Tests.AllProjects'
on:
workflow_dispatch:
pull_request:
paths:
- 'src/Lucene.Net.Tests.AllProjects/**/*'
- '.build/dependencies.props'
- '.build/TestReferences.Common.*'
- 'TestTargetFrameworks.*'
- '*.sln'
- 'src/Lucene.Net.Tests.AllProjects/Directory.Build.*'
- 'src/Directory.Build.*'
- 'Directory.Build.*'
- 'src/Lucene.Net.Tests/Support/ExceptionHandling/**/*.cs'
# Dependencies
- 'src/Lucene.Net/**/*'
- 'src/Lucene.Net.Analysis.Common/**/*'
- 'src/Lucene.Net.Memory/**/*'
- 'src/Lucene.Net.Queries/**/*'
- 'src/Lucene.Net.Highlighter/**/*'
- 'src/dotnet/Lucene.Net.ICU/**/*'
- 'src/Lucene.Net.Analysis.Kuromoji/**/*'
- 'src/Lucene.Net.Analysis.Morfologik/**/*'
- 'src/Lucene.Net.Analysis.Phonetic/**/*'
- 'src/Lucene.Net.Analysis.SmartCn/**/*'
- 'src/Lucene.Net.Analysis.Stempel/**/*'
- 'src/Lucene.Net.Grouping/**/*'
- 'src/Lucene.Net.Join/**/*'
- 'src/Lucene.Net.Facet/**/*'
- 'src/Lucene.Net.Sandbox/**/*'
- 'src/Lucene.Net.QueryParser/**/*'
- 'src/Lucene.Net.Spatial/**/*'
- 'src/Lucene.Net.Benchmark/**/*'
- 'src/Lucene.Net.Classification/**/*'
- 'src/Lucene.Net.Codecs/**/*'
- 'src/Lucene.Net.Expressions/**/*'
- 'src/Lucene.Net.Misc/**/*'
- 'src/Lucene.Net.Replicator/**/*'
- 'src/Lucene.Net.Suggest/**/*'
- 'src/Lucene.Net.TestFramework/**/*'
- 'src/Lucene.Net.Analysis.OpenNLP/**/*'
- '!**/*.md'
jobs:
Test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-22.04]
framework: [net8.0, net5.0, net48, net472]
platform: [x64]
configuration: [Release]
exclude:
- os: ubuntu-22.04
framework: net48
- os: ubuntu-22.04
framework: net472
- os: macos-latest
framework: net48
- os: macos-latest
framework: net472
env:
project_path: './src/Lucene.Net.Tests.AllProjects/Lucene.Net.Tests.AllProjects.csproj'
run_slow_tests: 'false'
trx_file_name: 'TestResults.trx'
md_file_name: 'TestResults.md' # Report file name for LiquidTestReports.Markdown
steps:
- name: Checkout Source Code
uses: actions/checkout@v3
- name: Disable .NET SDK Telemetry and Logo
run: |
echo "DOTNET_NOLOGO=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "DOTNET_CLI_TELEMETRY_OPTOUT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- name: Setup .NET 5 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '5.0.x'
if: ${{ startswith(matrix.framework, 'net5.') }}
- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
if: ${{ startswith(matrix.framework, 'net6.') }}
- name: Setup .NET 8 SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Setup Environment Variables
run: |
$project_name = [System.IO.Path]::GetFileNameWithoutExtension($env:project_path)
$test_results_artifact_name = "testresults_${{matrix.os}}_${{matrix.framework}}_${{matrix.platform}}_${{matrix.configuration}}"
$working_directory = "$env:GITHUB_WORKSPACE"
Write-Host "Project Name: $project_name"
Write-Host "Results Artifact Name: $test_results_artifact_name"
Write-Host "Working Directory: $working_directory"
echo "project_name=$project_name" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "test_results_artifact_name=$test_results_artifact_name" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Set the Azure DevOps default working directory env variable, so our tests only need to deal with a single env variable
echo "SYSTEM_DEFAULTWORKINGDIRECTORY=$working_directory" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# Title for LiquidTestReports.Markdown
echo "title=Test Run for $project_name - ${{matrix.framework}} - ${{matrix.platform}} - ${{matrix.os}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- run: dotnet build ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} /p:TestFrameworks=true
- run: dotnet test ${{env.project_path}} --configuration ${{matrix.configuration}} --framework ${{matrix.framework}} --no-build --no-restore --blame-hang --blame-hang-dump-type mini --blame-hang-timeout 20minutes --logger:"console;verbosity=normal" --logger:"trx;LogFileName=${{env.trx_file_name}}" --logger:"liquid.md;LogFileName=${{env.md_file_name}};Title=${{env.title}};" --results-directory:"${{github.workspace}}/${{env.test_results_artifact_name}}/${{env.project_name}}" -- RunConfiguration.TargetPlatform=${{matrix.platform}} TestRunParameters.Parameter\(name=\"tests:slow\",\ value=\"\${{env.run_slow_tests}}\"\)
shell: bash
# upload reports as build artifacts
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3
if: ${{always()}}
with:
name: '${{env.test_results_artifact_name}}'
path: '${{github.workspace}}/${{env.test_results_artifact_name}}'