Skip to content

Commit e999780

Browse files
[Backport 7.12] Unify most of our CI under github actions (#5379)
Co-authored-by: Martijn Laarman <Mpdreamz@gmail.com>
1 parent fba2257 commit e999780

35 files changed

+14791
-246
lines changed

.ci/packages.lock.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
".NETCoreApp,Version=v5.0": {}
5+
}
6+
}

.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: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
'7.0.0',
28+
'7.1.0',
29+
'7.2.0',
30+
'7.3.0',
31+
'7.4.0',
32+
'7.5.0',
33+
'7.6.0',
34+
'7.7.0',
35+
'7.8.0',
36+
'7.9.0',
37+
'7.10.0',
38+
'7.11.0',
39+
'7.12.0-SNAPSHOT',
40+
'latest-7'
41+
]
42+
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v2
46+
- uses: actions/setup-dotnet@v1
47+
with:
48+
dotnet-version: '5.0.100'
49+
- uses: actions/cache@v2
50+
with:
51+
path: ~/.nuget/packages
52+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
53+
restore-keys: |
54+
${{ runner.os }}-nuget-
55+
- uses: actions/cache@v2
56+
with:
57+
path: ~/.local/share/ElasticManaged/elasticsearch-${{ matrix.stack_version }}
58+
key: ${{ runner.os }}-elastic-managed-${{ matrix.stack_version }}
59+
restore-keys: |
60+
${{ runner.os }}-elastic-managed-
61+
62+
- run: "./build.sh integrate ${{ matrix.stack_version }} readonly,writable random:test_only_one --report"
63+
name: ${{ matrix.stack_version }}
64+
- name: Results ${{ matrix.stack_version }}
65+
# only report on if the previous run failed, otherwise this ends up being too noisy
66+
if: ${{ failure() }}
67+
uses: mikepenz/action-junit-report@v2
68+
with:
69+
report_paths: 'build/output/junit-*.xml'
70+
github_token: ${{ secrets.GITHUB_TOKEN }}
71+
fail_on_failure: true
72+
require_tests: true
73+
check_name: ${{ matrix.stack_version }}
74+

.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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
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>

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.

0 commit comments

Comments
 (0)