-
Notifications
You must be signed in to change notification settings - Fork 95
59 lines (52 loc) · 2.13 KB
/
build-container.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
name: Build on Containers
on:
workflow_call:
env:
NUGET_PACKAGES: ${{ github.workspace }}/packages
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build-container:
strategy:
fail-fast: false
matrix:
include:
- machine: ubuntu-20.04
base-image: alpine
os-type: linux-musl
architecture: x64
- machine: otel-linux-arm64
base-image: alpine
os-type: linux-musl
architecture: arm64
runs-on: ${{ matrix.machine }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2
with:
fetch-depth: 0 # fetching all, needed to correctly calculate version
- name: Build in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" ./docker
docker run -e OS_TYPE=${{ matrix.os-type }} --rm --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project mybuildimage \
/bin/sh -c 'git config --global --add safe.directory /project && ./build.sh BuildWorkflow'
- name: Test the Shell scripts from README.md in Docker container
run: |
set -e
docker build -t mybuildimage -f "./docker/${{ matrix.base-image }}.dockerfile" ./docker
docker run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c '
set -e
dotnet publish -f net9.0 -c Release ./test/test-applications/integrations/TestApplication.Smoke
export OTEL_DOTNET_AUTO_HOME="${PWD}/bin/tracer-home"
. ./instrument.sh
./test/test-applications/integrations/bin/TestApplication.Smoke/Release/net9.0/publish/TestApplication.Smoke
test "$(ls -A /var/log/opentelemetry/dotnet )"
'
- name: Publish Linux build
if: (${{ job.status }} != 'cancelled')
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # tag: v4.5.0
with:
name: bin-${{ matrix.base-image }}-${{ matrix.architecture }}
path: bin/tracer-home
continue-on-error: true