-
Notifications
You must be signed in to change notification settings - Fork 131
62 lines (54 loc) · 2.13 KB
/
build-container.yml
File metadata and controls
62 lines (54 loc) · 2.13 KB
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
name: Build on Containers
on:
workflow_call:
permissions:
contents: read
env:
NUGET_PACKAGES: ${{ github.workspace }}/packages
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build-container:
strategy:
fail-fast: false
matrix:
include:
- machine: ubuntu-22.04
base-image: alpine
os-type: linux-musl
architecture: x64
- machine: ubuntu-22.04-arm
base-image: alpine
os-type: linux-musl
architecture: arm64
runs-on: ${{ matrix.machine }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # tag: v6.0.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 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 run --mount type=bind,source="${GITHUB_WORKSPACE}",target=/project --rm mybuildimage /bin/sh -c '
set -e
dotnet publish -f net10.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/net10.0/publish/TestApplication.Smoke
test "$(ls -A /var/log/opentelemetry/dotnet )"
'
- name: Publish Linux build
if: ${{ !cancelled() }}
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # tag: v7.0.0
with:
name: bin-${{ matrix.base-image }}-${{ matrix.architecture }}
path: bin/tracer-home
continue-on-error: true