-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from elastic/feature/github-actions
Add GitHub Actions to project
- Loading branch information
Showing
33 changed files
with
243 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<IsPackable>False</IsPackable> | ||
</PropertyGroup> | ||
|
||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
script_path=$(dirname $(realpath $0))/../ | ||
|
||
function add_license () { | ||
(find "$script_path" -name $1 | grep -v "/bin/" | grep -v "/obj/" )|while read fname; do | ||
line=$(sed -n '2p;3q' "$fname") | ||
if ! [[ "$line" == " * Licensed to Elasticsearch B.V. under one or more contributor" ]] ; then | ||
cat "${script_path}.github/license-header.txt" "$fname" > "${fname}.new" | ||
mv "${fname}.new" "$fname" | ||
fi | ||
done | ||
} | ||
|
||
add_license "*.cs" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Check that source code files in this repo have the appropriate license | ||
# header. | ||
|
||
if [ "$TRACE" != "" ]; then | ||
export PS4='${BASH_SOURCE}:${LINENO}: ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' | ||
set -o xtrace | ||
fi | ||
set -o errexit | ||
set -o pipefail | ||
|
||
TOP=$(cd "$(dirname "$0")/.." >/dev/null && pwd) | ||
NLINES=$(wc -l .github/license-header.txt | awk '{print $1}') | ||
|
||
function check_license_header { | ||
local f | ||
f=$1 | ||
if ! diff .github/license-header.txt <(head -$NLINES "$f") >/dev/null; then | ||
echo "check-license-headers: error: '$f' does not have required license header, see 'diff -u .github/license-header.txt <(head -$NLINES $f)'" | ||
return 1 | ||
else | ||
return 0 | ||
fi | ||
} | ||
|
||
cd "$TOP" | ||
nErrors=0 | ||
for f in $(git ls-files | grep '\.cs$'); do | ||
if ! check_license_header $f; then | ||
nErrors=$((nErrors+1)) | ||
fi | ||
done | ||
|
||
for f in $(git ls-files | grep '\.fs$'); do | ||
if ! check_license_header $f; then | ||
nErrors=$((nErrors+1)) | ||
fi | ||
done | ||
|
||
if [[ $nErrors -eq 0 ]]; then | ||
exit 0 | ||
else | ||
exit 1 | ||
fi |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// Licensed to Elasticsearch B.V under one or more agreements. | ||
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. | ||
// See the LICENSE file in the project root for more information |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Always be deploying | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'README.md' | ||
- '.editorconfig' | ||
push: | ||
paths-ignore: | ||
- 'README.md' | ||
- '.editorconfig' | ||
branches: | ||
- main | ||
tags: | ||
- "*.*.*" | ||
|
||
jobs: | ||
test-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- run: | | ||
git fetch --prune --unshallow --tags | ||
echo exit code $? | ||
git tag --list | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: | | ||
8.0.x | ||
6.0.x | ||
source-url: https://nuget.pkg.github.com/elastic/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
- run: build.bat test | ||
shell: cmd | ||
name: Test | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
- run: | | ||
git fetch --prune --unshallow --tags | ||
echo exit code $? | ||
git tag --list | ||
- uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
8.0.x | ||
source-url: https://nuget.pkg.github.com/elastic/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- run: ./build.sh release | ||
name: Release | ||
|
||
- name: publish canary packages github package repository | ||
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads') | ||
shell: bash | ||
run: | | ||
until dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols; do echo "Retrying"; sleep 1; done; | ||
# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io | ||
- 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 | ||
name: publish canary packages to feedz.io | ||
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/heads') | ||
|
||
- run: dotnet nuget push 'build/output/*.nupkg' -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols | ||
name: release to nuget.org | ||
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/tags') |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: License headers | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Check license headers | ||
run: | | ||
./.github/check-license-headers.sh |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
dotnet run --project build/scripts -- %* | ||
@echo off | ||
dotnet run --project build -c debug -- %* | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
dotnet run --project build -- "$@" | ||
dotnet run --project build -c release -- "$@" |
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
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
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
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
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
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
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
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
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Extensions/MeterBuilderProviderExtensions.cs
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Extensions/ResourceBuilderExtensions.cs
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Extensions/TraceBuilderProviderExtensions.cs
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
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
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Processors/SpanCompressionProcessor.cs
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
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
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Processors/TransactionIdProcessor.cs
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Resources/DefaultServiceDetector.cs
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/Resources/ElasticEnvironmentVariableDetector.cs
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
3 changes: 3 additions & 0 deletions
3
src/Elastic.OpenTelemetry/SemanticConventions/ResourceSemanticConventions.cs
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
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
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
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