Skip to content

Commit 2eed547

Browse files
authored
[Backport master] Unify most of our CI under github actions (#5382)
1 parent 22005a1 commit 2eed547

39 files changed

+16653
-211
lines changed

.ci/packages.lock.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
".NETCoreApp,Version=v5.0": {
5+
"Microsoft.NETFramework.ReferenceAssemblies": {
6+
"type": "Direct",
7+
"requested": "[1.0.0-preview.2, )",
8+
"resolved": "1.0.0-preview.2",
9+
"contentHash": "m+pJPEO7HyXvrOna5Sr3s77ewXonjYWJTNL6drh8xACnMNxnlqUDKx9HfGeSE9wmfY0lQwppaeZpFTPGaH7kZg=="
10+
}
11+
}
12+
}
13+
}

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ indent_size = 4
1212
indent_style = tab
1313
indent_size = 4
1414

15-
[*.{fs,fsx,yml}]
15+
[*.{fs,fsx}]
1616
indent_style = space
1717
indent_size = 4
1818

19-
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props}]
19+
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props,yml}]
2020
indent_style = space
2121
indent_size = 2
2222

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Integration
2+
3+
4+
on:
5+
pull_request:
6+
paths-ignore:
7+
- 'README.md'
8+
- '.editorconfig'
9+
push:
10+
paths-ignore:
11+
- 'README.md'
12+
- '.editorconfig'
13+
branches:
14+
- main
15+
- master
16+
- '[0-9]+.[0-9]+'
17+
- '[0-9]+.x'
18+
19+
jobs:
20+
integration-tests:
21+
name: Tests
22+
runs-on: ubuntu-latest
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
stack_version: [
27+
'latest'
28+
]
29+
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v2
33+
- uses: actions/setup-dotnet@v1
34+
with:
35+
dotnet-version: '5.0.100'
36+
- uses: actions/cache@v2
37+
with:
38+
path: ~/.nuget/packages
39+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
40+
restore-keys: |
41+
${{ runner.os }}-nuget-
42+
- uses: actions/cache@v2
43+
with:
44+
path: ~/.local/share/ElasticManaged/elasticsearch-${{ matrix.stack_version }}
45+
key: ${{ runner.os }}-elastic-managed-${{ matrix.stack_version }}
46+
restore-keys: |
47+
${{ runner.os }}-elastic-managed-
48+
49+
- run: "./build.sh integrate ${{ matrix.stack_version }} readonly,writable random:test_only_one --report"
50+
name: ${{ matrix.stack_version }}
51+
- name: Results ${{ matrix.stack_version }}
52+
# only report on if the previous run failed, otherwise this ends up being too noisy
53+
if: ${{ failure() }}
54+
uses: mikepenz/action-junit-report@v2
55+
with:
56+
report_paths: 'build/output/junit-*.xml'
57+
github_token: ${{ secrets.GITHUB_TOKEN }}
58+
fail_on_failure: true
59+
require_tests: true
60+
check_name: ${{ matrix.stack_version }}
61+

.github/workflows/stale-jobs.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Stale
2+
3+
4+
on:
5+
pull_request:
6+
paths-ignore:
7+
- 'README.md'
8+
- '.editorconfig'
9+
push:
10+
paths-ignore:
11+
- 'README.md'
12+
- '.editorconfig'
13+
branches:
14+
- main
15+
- master
16+
- '[0-9]+.[0-9]+'
17+
- '[0-9]+.x'
18+
19+
jobs:
20+
unit-tests:
21+
name: Documentation
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: '5.0.100'
29+
- uses: actions/cache@v2
30+
with:
31+
path: ~/.nuget/packages
32+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-nuget-
35+
36+
- run: ./build.sh documentation
37+
name: Build docs
38+
39+
- run: |
40+
if [ -n "$(git status --porcelain)" ]; then echo Error: changes found after running documentation; git diff; git status; exit 1; fi
41+
name: 'Ensure no stale docs'
42+
if: github.event_name == 'pull_request' && startswith(github.ref, 'refs/heads') && github.repository == 'elastic/elasticsearch-net'
43+
44+

.github/workflows/test-jobs.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Tests
2+
3+
4+
on:
5+
pull_request:
6+
paths-ignore:
7+
- 'README.md'
8+
- '.editorconfig'
9+
push:
10+
paths-ignore:
11+
- 'README.md'
12+
- '.editorconfig'
13+
branches:
14+
- main
15+
- master
16+
- '[0-9]+.[0-9]+'
17+
- '[0-9]+.x'
18+
19+
jobs:
20+
unit-tests:
21+
name: Unit
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
- uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: '5.0.100'
29+
- uses: actions/cache@v2
30+
with:
31+
path: ~/.nuget/packages
32+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-nuget-
35+
36+
- run: ./build.sh test --report
37+
name: Test
38+
- name: Test Results
39+
if: always()
40+
uses: mikepenz/action-junit-report@v2
41+
with:
42+
report_paths: 'build/output/junit-*.xml'
43+
github_token: ${{ secrets.GITHUB_TOKEN }}
44+
fail_on_failure: true
45+
require_tests: true
46+
check_name: Unit Test Results
47+
48+
# Packages nuget packages first and then uses the nuget packages to test
49+
# Also builds versioned nuget packages
50+
canary-tests:
51+
name: Canary
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
- uses: actions/setup-dotnet@v1
57+
with:
58+
dotnet-version: '5.0.100'
59+
- uses: actions/cache@v2
60+
with:
61+
path: ~/.nuget/packages
62+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
63+
restore-keys: |
64+
${{ runner.os }}-nuget-
65+
66+
- run: ./build.sh canary --report
67+
name: Test
68+
- name: Test Results
69+
if: always()
70+
uses: mikepenz/action-junit-report@v2
71+
with:
72+
report_paths: 'build/output/junit-*.xml'
73+
github_token: ${{ secrets.GITHUB_TOKEN }}
74+
fail_on_failure: true
75+
require_tests: true
76+
check_name: Canary Test Results
77+
78+
# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
79+
# Only runs on builds on heads
80+
- run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols true
81+
name: publish canary packages to feedz.io
82+
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
83+

Directory.Build.props

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,17 @@
3333
<OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(MSBuildProjectName)\</OutputPath>
3434
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))</SolutionRoot>
3535

36+
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
37+
3638
<DefineConstants Condition="'$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472'">$(DefineConstants);FULLFRAMEWORK</DefineConstants>
3739
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False">$(DefineConstants);DOTNETCORE</DefineConstants>
3840
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False and '$(TargetFramework)'!='netstandard2.0'">$(DefineConstants);DOTNETCORE_2_1_OR_HIGHER</DefineConstants>
3941

4042
<ExposedPublicKey>002400000480000094000000060200000024000052534131000400000100010025d3a22bf3781ba85067374ad832dfcba3c4fa8dd89227e36121ba17b2c33ad6b6ce03e45e562050a031e2ff7fe12cff9060a50acbc6a0eef9ef32dc258d90f874b2e76b581938071ccc4b4d98204d1d6ca7a1988d7a211f9fc98efd808cf85f61675b11007d0eb0461dc86a968d6af8ebba7e6b540303b54f1c1f5325c252be</ExposedPublicKey>
4143
</PropertyGroup>
4244
<ItemGroup>
43-
<PackageReference Condition="'$(OS)' != 'Windows_NT' and $(DefineConstants.Contains(FULLFRAMEWORK))" Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2"/>
45+
<!-- Include unconditionally due to difference in how dotnet cli and design time builds generate package.lock.json -->
46+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2"/>
4447
</ItemGroup>
45-
46-
47-
48-
<!---
49-
On CI we run the tests projects with them directly referencing the nuget packages
50-
This adds the ouput path to restore sources. The reason we only do this on CI is because otherwise our development machine's nuget cache
51-
would take on docker'esque proportions!
52-
-->
53-
<PropertyGroup Condition="'$(TestPackageVersion)'!=''">
54-
<RestoreSources>$(SolutionRoot)/build/output;https://api.nuget.org/v3/index.json</RestoreSources>
55-
</PropertyGroup>
5648

5749
</Project>

Elasticsearch.sln

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{EAE89579-C
3838
ProjectSection(SolutionItems) = preProject
3939
.editorconfig = .editorconfig
4040
.gitignore = .gitignore
41-
appveyor.yml = appveyor.yml
4241
global.json = global.json
43-
azure-pipelines.yml = azure-pipelines.yml
4442
nuget.config = nuget.config
4543
dotnet-tools.json = dotnet-tools.json
4644
EndProjectSection

appveyor.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)