-
Notifications
You must be signed in to change notification settings - Fork 206
166 lines (139 loc) · 4.45 KB
/
test-linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: test-linux
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- '*.asciidoc'
- 'docs/**'
pull_request:
paths-ignore:
- '*.md'
- '*.asciidoc'
- 'docs/**'
permissions:
contents: read
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
defaults:
run:
shell: bash
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
# 'pack' & 'tests' are required checks in this workflow.
# To not burn unneeded CI cycles:
# - Our required checks will always succeed if doc only changes are detected.
# - all jobs depend on 'format' to not waste cycles on quickly fixable errors.
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
- name: Format
run: ./build.sh format
#required step
pack:
runs-on: ubuntu-latest
needs: [ 'format' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
with:
rust: 'true'
- name: Package
run: ./build.sh pack
#required step
tests:
runs-on: ubuntu-latest
needs: [ 'format' ]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
- name: 'Tests: Unit'
run: ./build.sh test --test-suite unit
azure-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
if: |
github.event_name != 'pull_request'
|| github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false && github.actor != 'dependabot[bot]'
env:
ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
ARM_USE_OIDC: true
AZURE_RESOURCE_GROUP_PREFIX: ci-dotnet-${{ github.run_id }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
with:
azure: 'true'
- name: 'Az CLI login'
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0
with:
client-id: ${{ secrets.ARM_CLIENT_ID }}
tenant-id: ${{ secrets.ARM_TENANT_ID }}
subscription-id: ${{ secrets.ARM_SUBSCRIPTION_ID }}
- name: 'Tests: Azure'
run: ./build.sh test --test-suite azure
- name: 'Teardown tests infra'
if: ${{ always() }}
run: |
for group in $(az group list --query "[?name | starts_with(@,'${{ env.AZURE_RESOURCE_GROUP_PREFIX }}')]" --out json | jq .[].name --raw-output); do
az group delete --name "${group}" --no-wait --yes
done
integration-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
- name: 'Tests: Integrations'
run: ./build.sh test --test-suite integrations
- name: Store crash dumps
uses: actions/upload-artifact@v4
if: failure()
with:
name: hang-dumps
retention-days: 3
path: |
build/output/**/*.dmp
build/output/**/*.xml
build/output/**/*.pdb
startup-hook-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
- name: 'Tests: StartupHooks'
run: ./build.sh test --test-suite startuphooks
profiler-tests:
runs-on: ubuntu-latest
needs: [ 'format', 'tests' ]
steps:
- uses: actions/checkout@v4
- name: Bootstrap Action Workspace
id: bootstrap
uses: ./.github/workflows/bootstrap
with:
rust: 'true'
- name: 'Tests: Profiler'
run: ./build.sh test --test-suite profiler
- name: Build Profiler Docker Image
run: |
docker build . -t docker.elastic.co/observability/apm-agent-dotnet:${{ steps.bootstrap.outputs.agent-version }} \
--build-arg AGENT_ZIP_FILE=build/output/elastic_apm_profiler_${{ steps.bootstrap.outputs.agent-version }}-linux-x64.zip