-
Notifications
You must be signed in to change notification settings - Fork 6
149 lines (125 loc) · 4.45 KB
/
main_build.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
name: DotNet Instrumentation Main Build
on:
workflow_call:
inputs:
caller-workflow-name:
required: true
type: string
push:
branches:
- main
- "release/v*"
permissions:
id-token: write
contents: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- name: Build on Linux
if: runner.os == 'Linux'
run: bash build.sh
- name: Build on Windows
if: runner.os == 'Windows'
run: .\build.cmd
- name: Test on Linux
if: runner.os == 'Linux'
run: dotnet test
- name: Test on Windows
if: runner.os == 'Windows'
run: dotnet test
- name: Upload Artifact on X64 Linux
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip
path: bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-x64.zip
- name: Upload bash installation script
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: aws-otel-dotnet-install.sh
path: bin/InstallationScripts/aws-otel-dotnet-install.sh
- name: Upload psm1 installation script
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: AWS.Otel.DotNet.Auto.psm1
path: bin/InstallationScripts/AWS.Otel.DotNet.Auto.psm1
- name: Upload Artifact on Windows
if: runner.os == 'Windows'
uses: actions/upload-artifact@v3
with:
name: aws-distro-opentelemetry-dotnet-instrumentation-windows.zip
path: bin/aws-distro-opentelemetry-dotnet-instrumentation-windows.zip
build-x64-musl:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
with:
fetch-depth: 0
- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/alpine.dockerfile" ./docker
docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && dotnet test && ./build.sh'
- name: Upload Artifact on MUSL X64 Linux
uses: actions/upload-artifact@v3
with:
name: aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-x64.zip
path: bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-x64.zip
build-arm64:
runs-on: codebuild-adot-dotnet-runner-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
- name: Build on Linux
run: bash build.sh
- name: Test on Linux
run: dotnet test
- name: Upload Artifact on arm64 Linux
uses: actions/upload-artifact@v3
with:
name: aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip
path: bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-glibc-arm64.zip
build-arm64-musl:
runs-on: codebuild-adot-dotnet-runner-${{ github.run_id }}-${{ github.run_attempt }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.2
with:
fetch-depth: 0
- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/alpine.dockerfile" ./docker
docker run --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && dotnet test && ./build.sh'
- name: Upload Artifact on MUSL arm64 Linux
uses: actions/upload-artifact@v3
with:
name: aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-arm64.zip
path: bin/aws-distro-opentelemetry-dotnet-instrumentation-linux-musl-arm64.zip
application-signals-e2e-test:
name: "Application Signals E2E Test"
needs: [ build ]
uses: ./.github/workflows/application-signals-e2e-test.yml
secrets: inherit
permissions:
id-token: write
contents: read