Skip to content

[Backport master] Unify most of our CI under github actions #5382

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .ci/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"version": 1,
"dependencies": {
".NETCoreApp,Version=v5.0": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
"requested": "[1.0.0-preview.2, )",
"resolved": "1.0.0-preview.2",
"contentHash": "m+pJPEO7HyXvrOna5Sr3s77ewXonjYWJTNL6drh8xACnMNxnlqUDKx9HfGeSE9wmfY0lQwppaeZpFTPGaH7kZg=="
}
}
}
}
4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ indent_size = 4
indent_style = tab
indent_size = 4

[*.{fs,fsx,yml}]
[*.{fs,fsx}]
indent_style = space
indent_size = 4

[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props}]
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props,yml}]
indent_style = space
indent_size = 2

Expand Down
61 changes: 61 additions & 0 deletions .github/workflows/integration-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Integration


on:
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- main
- master
- '[0-9]+.[0-9]+'
- '[0-9]+.x'

jobs:
integration-tests:
name: Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
stack_version: [
'latest'
]

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/cache@v2
with:
path: ~/.local/share/ElasticManaged/elasticsearch-${{ matrix.stack_version }}
key: ${{ runner.os }}-elastic-managed-${{ matrix.stack_version }}
restore-keys: |
${{ runner.os }}-elastic-managed-

- run: "./build.sh integrate ${{ matrix.stack_version }} readonly,writable random:test_only_one --report"
name: ${{ matrix.stack_version }}
- name: Results ${{ matrix.stack_version }}
# only report on if the previous run failed, otherwise this ends up being too noisy
if: ${{ failure() }}
uses: mikepenz/action-junit-report@v2
with:
report_paths: 'build/output/junit-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_failure: true
require_tests: true
check_name: ${{ matrix.stack_version }}

44 changes: 44 additions & 0 deletions .github/workflows/stale-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Stale


on:
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- main
- master
- '[0-9]+.[0-9]+'
- '[0-9]+.x'

jobs:
unit-tests:
name: Documentation
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- run: ./build.sh documentation
name: Build docs

- run: |
if [ -n "$(git status --porcelain)" ]; then echo Error: changes found after running documentation; git diff; git status; exit 1; fi
name: 'Ensure no stale docs'
if: github.event_name == 'pull_request' && startswith(github.ref, 'refs/heads') && github.repository == 'elastic/elasticsearch-net'


83 changes: 83 additions & 0 deletions .github/workflows/test-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Tests


on:
pull_request:
paths-ignore:
- 'README.md'
- '.editorconfig'
push:
paths-ignore:
- 'README.md'
- '.editorconfig'
branches:
- main
- master
- '[0-9]+.[0-9]+'
- '[0-9]+.x'

jobs:
unit-tests:
name: Unit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- run: ./build.sh test --report
name: Test
- name: Test Results
if: always()
uses: mikepenz/action-junit-report@v2
with:
report_paths: 'build/output/junit-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_failure: true
require_tests: true
check_name: Unit Test Results

# Packages nuget packages first and then uses the nuget packages to test
# Also builds versioned nuget packages
canary-tests:
name: Canary
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.100'
- uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- run: ./build.sh canary --report
name: Test
- name: Test Results
if: always()
uses: mikepenz/action-junit-report@v2
with:
report_paths: 'build/output/junit-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_failure: true
require_tests: true
check_name: Canary Test Results

# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
# Only runs on builds on heads
- 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
name: publish canary packages to feedz.io
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')

16 changes: 4 additions & 12 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,17 @@
<OutputPath Condition="'$(OutputPathBaseDir)' != ''">$(OutputPathBaseDir)\$(MSBuildProjectName)\</OutputPath>
<SolutionRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), build.bat))</SolutionRoot>

<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>

<DefineConstants Condition="'$(TargetFramework)'=='net461' or '$(TargetFramework)'=='net472'">$(DefineConstants);FULLFRAMEWORK</DefineConstants>
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False">$(DefineConstants);DOTNETCORE</DefineConstants>
<DefineConstants Condition="$(DefineConstants.Contains(FULLFRAMEWORK)) == False and '$(TargetFramework)'!='netstandard2.0'">$(DefineConstants);DOTNETCORE_2_1_OR_HIGHER</DefineConstants>

<ExposedPublicKey>002400000480000094000000060200000024000052534131000400000100010025d3a22bf3781ba85067374ad832dfcba3c4fa8dd89227e36121ba17b2c33ad6b6ce03e45e562050a031e2ff7fe12cff9060a50acbc6a0eef9ef32dc258d90f874b2e76b581938071ccc4b4d98204d1d6ca7a1988d7a211f9fc98efd808cf85f61675b11007d0eb0461dc86a968d6af8ebba7e6b540303b54f1c1f5325c252be</ExposedPublicKey>
</PropertyGroup>
<ItemGroup>
<PackageReference Condition="'$(OS)' != 'Windows_NT' and $(DefineConstants.Contains(FULLFRAMEWORK))" Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2"/>
<!-- Include unconditionally due to difference in how dotnet cli and design time builds generate package.lock.json -->
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0-preview.2"/>
</ItemGroup>



<!---
On CI we run the tests projects with them directly referencing the nuget packages
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
would take on docker'esque proportions!
-->
<PropertyGroup Condition="'$(TestPackageVersion)'!=''">
<RestoreSources>$(SolutionRoot)/build/output;https://api.nuget.org/v3/index.json</RestoreSources>
</PropertyGroup>

</Project>
2 changes: 0 additions & 2 deletions Elasticsearch.sln
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Root", "Root", "{EAE89579-C
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
appveyor.yml = appveyor.yml
global.json = global.json
azure-pipelines.yml = azure-pipelines.yml
nuget.config = nuget.config
dotnet-tools.json = dotnet-tools.json
EndProjectSection
Expand Down
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

112 changes: 0 additions & 112 deletions azure-pipelines.yml

This file was deleted.

Loading