Skip to content

Commit abe57da

Browse files
committed
Merge branch 'main' into feature/integration-tests
2 parents 2c35cf6 + 3ce1172 commit abe57da

File tree

10 files changed

+349
-96
lines changed

10 files changed

+349
-96
lines changed

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ charset = utf-8
55
indent_style = tab
66
indent_size = 4
77
# Spell checker configuration
8-
spelling_exclusion_path = ./build/exclusion.dic
8+
spelling_exclusion_path = "./build/exclusion.dic"
99

10-
[*.{fs,fsx,yml}]
10+
[*.{fs,fsx}]
1111
indent_style = space
1212
indent_size = 4
1313

14-
[*.{md,markdown,json,js,csproj,fsproj,targets,targets,props}]
14+
[*.{md,markdown,json,js,yml,csproj,fsproj,targets,targets,props}]
1515
indent_style = space
1616
indent_size = 2
1717

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Bootstrap Checkout
3+
description: Ensures all actions bootstrap the same
4+
5+
outputs:
6+
agent-version:
7+
description: "The current agent version number"
8+
value: ${{ steps.dotnet.outputs.agent-version }}
9+
major-version:
10+
description: "The current major version number, semver"
11+
value: ${{ steps.dotnet.outputs.major-version }}
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
# Ensure we fetch all tags
17+
- shell: bash
18+
run: |
19+
git fetch --prune --unshallow --tags
20+
git tag --list
21+
22+
- uses: actions/cache@v3
23+
with:
24+
path: ~/.nuget/packages
25+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.[cf]sproj*') }}
26+
restore-keys: |
27+
${{ runner.os }}-nuget
28+
29+
- name: Setup dotnet
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: |
33+
6.0.x
34+
8.0.x
35+
6.0.x
36+
- id: dotnet
37+
shell: bash
38+
run: |
39+
dotnet --list-sdks
40+
dotnet tool restore
41+
AGENT_VERSION=$(dotnet minver -t=v -p=canary.0 -v=e)
42+
echo "Version Number: ${AGENT_VERSION}"
43+
echo "AGENT_VERSION=${AGENT_VERSION}" >> $GITHUB_ENV
44+
echo "agent-version=${AGENT_VERSION}" >> $GITHUB_OUTPUT
45+
echo "major-version=$(echo ${AGENT_VERSION} | cut -d"." -f1)" >> $GITHUB_OUTPUT
46+
47+
48+
# Setup git config
49+
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current

.github/workflows/ci.yml

Lines changed: 44 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,50 @@
1-
name: Always be deploying
1+
name: Pull Request Validation
22

33
on:
4-
pull_request:
5-
paths-ignore:
6-
- 'README.md'
7-
- '.editorconfig'
8-
push:
9-
paths-ignore:
10-
- 'README.md'
11-
- '.editorconfig'
12-
branches:
13-
- main
14-
tags:
15-
- "*.*.*"
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '*.md'
9+
- '*.asciidoc'
10+
- 'docs/**'
11+
pull_request:
12+
paths-ignore:
13+
- '*.md'
14+
- '*.asciidoc'
15+
- 'docs/**'
1616

17-
jobs:
18-
test-windows:
19-
runs-on: windows-latest
20-
steps:
21-
- uses: actions/checkout@v2
22-
with:
23-
fetch-depth: 1
24-
- run: |
25-
git fetch --prune --unshallow --tags
26-
echo exit code $?
27-
git tag --list
28-
- uses: actions/setup-dotnet@v1
29-
with:
30-
dotnet-version: |
31-
8.0.x
32-
6.0.x
33-
source-url: https://nuget.pkg.github.com/elastic/index.json
34-
env:
35-
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
36-
- run: build.bat test
37-
shell: cmd
38-
name: Test
39-
40-
build:
41-
runs-on: ubuntu-latest
42-
steps:
43-
- uses: actions/checkout@v2
44-
with:
45-
fetch-depth: 1
46-
- run: |
47-
git fetch --prune --unshallow --tags
48-
echo exit code $?
49-
git tag --list
50-
- uses: actions/setup-dotnet@v1
51-
with:
52-
# .NET 7 is sadly required for the licenses check tool
53-
# https://github.com/tomchavakis/nuget-license/issues/200
54-
dotnet-version: |
55-
6.0.x
56-
7.0.x
57-
8.0.x
58-
source-url: https://nuget.pkg.github.com/elastic/index.json
59-
env:
60-
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
17+
permissions:
18+
contents: read
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
6123

62-
- run: ./build.sh release
63-
name: Release
24+
env:
25+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
26+
27+
jobs:
28+
test-windows:
29+
runs-on: windows-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
- name: Bootstrap Action Workspace
33+
id: bootstrap
34+
uses: ./.github/workflows/bootstrap
6435

65-
- name: publish canary packages github package repository
66-
if: github.event_name == 'push' && startswith(github.ref, 'refs/heads')
67-
shell: bash
68-
# this is a best effort to push to GHPR, we've observed it being unavailable intermittently
69-
continue-on-error: true
70-
run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols
71-
72-
# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
73-
- run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols
74-
name: publish canary packages to feedz.io
75-
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/heads')
36+
- run: build.bat test
37+
shell: cmd
38+
name: Test
39+
40+
build:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Bootstrap Action Workspace
45+
id: bootstrap
46+
uses: ./.github/workflows/bootstrap
7647

77-
- run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.NUGET_ORG_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols
78-
name: release to nuget.org
79-
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/tags')
48+
# We still run the full release build on pull-requests this ensures packages are validated ahead of time
49+
- run: ./build.sh release
50+
name: Release

.github/workflows/e2e.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: e2e
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '*.md'
9+
- '*.asciidoc'
10+
- 'docs/**'
11+
pull_request:
12+
paths-ignore:
13+
- '*.md'
14+
- '*.asciidoc'
15+
- 'docs/**'
16+
17+
permissions:
18+
contents: read
19+
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}
22+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
23+
24+
env:
25+
# keep_serverless-staging-oblt OR keep_serverless-qa-oblt
26+
SERVERLESS_PROJECT: serverless-production-oblt
27+
28+
jobs:
29+
test:
30+
if: |
31+
github.event_name != 'pull_request' ||
32+
(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false)
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Setup Git
38+
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
39+
40+
- uses: elastic/apm-pipeline-library/.github/actions/github-token@current
41+
with:
42+
url: ${{ secrets.VAULT_ADDR }}
43+
roleId: ${{ secrets.VAULT_ROLE_ID }}
44+
secretId: ${{ secrets.VAULT_SECRET_ID }}
45+
46+
- uses: elastic/apm-pipeline-library/.github/actions/oblt-cli-cluster-credentials@current
47+
with:
48+
github-token: ${{ env.GITHUB_TOKEN }}
49+
cluster-name: ${{ env.SERVERLESS_PROJECT }}
50+
vault-url: ${{ secrets.VAULT_ADDR }}
51+
vault-role-id: ${{ secrets.VAULT_ROLE_ID }}
52+
vault-secret-id: ${{ secrets.VAULT_SECRET_ID }}
53+
54+
# TODO: run the e2e targeting the required endpoint.
55+
# those values can be found in https://github.com/elastic/apm-pipeline-library/tree/main/.github/actions/oblt-cli-cluster-credentials#outputs
56+
- run: curl -X GET "${ELASTICSEARCH_HOST}/_cat/indices?v" -u ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}

.github/workflows/license.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: License headers
22

3-
on: [pull_request]
3+
on: [ pull_request ]
44

55
jobs:
66
build:
77

88
runs-on: ubuntu-latest
99

1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212

13-
- name: Check license headers
14-
run: |
15-
./.github/check-license-headers.sh
13+
- name: Check license headers
14+
run: |
15+
./.github/check-license-headers.sh

.github/workflows/opentelemetry.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
# Look up results at https://ela.st/oblt-ci-cd-stats
3+
# There will be one service per GitHub repository, including the org name, and one Transaction per Workflow.
4+
name: OpenTelemetry Export Trace
5+
6+
on:
7+
workflow_run:
8+
workflows: [ "*" ]
9+
types: [completed]
10+
11+
permissions:
12+
contents: read
13+
actions: read
14+
15+
jobs:
16+
otel-export-trace:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current
20+
with:
21+
vaultUrl: ${{ secrets.VAULT_ADDR }}
22+
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
23+
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}

.github/workflows/prerelease.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: release-main
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
packages: write
11+
12+
env:
13+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Bootstrap Action Workspace
21+
id: bootstrap
22+
uses: ./.github/workflows/bootstrap
23+
24+
- run: ./build.sh release
25+
name: Release
26+
27+
- name: publish canary packages github package repository
28+
shell: bash
29+
# this is a best effort to push to GHPR, we've observed it being unavailable intermittently
30+
continue-on-error: true
31+
run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.GITHUB_TOKEN}} --skip-duplicate --no-symbols
32+
33+
# Github packages requires authentication, this is likely going away in the future so for now we publish to feedz.io
34+
- run: dotnet nuget push '.artifacts/package/release/*.nupkg' -k ${{secrets.FEEDZ_IO_API_KEY}} -s https://f.feedz.io/elastic/all/nuget/index.json --skip-duplicate --no-symbols
35+
name: publish canary packages to feedz.io
36+
if: false && github.event_name == 'push' && startswith(github.ref, 'refs/heads')
37+

0 commit comments

Comments
 (0)