Skip to content

Added git commit SHA to image build for staging (#141) #179

Added git commit SHA to image build for staging (#141)

Added git commit SHA to image build for staging (#141) #179

Workflow file for this run

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