Skip to content

Merge branch 'main' of https://github.com/malkia/opentelemetry-cpp #1054

Merge branch 'main' of https://github.com/malkia/opentelemetry-cpp

Merge branch 'main' of https://github.com/malkia/opentelemetry-cpp #1054

Workflow file for this run

name: otel_sdk
# Example:
# git tag -a v1.14.2.dll.x -m "Release 1.14.2.dll.x" && git push --tags
on:
push:
tags:
- "*"
branches:
- main
env:
# D: drive used to be disabled for some time (Jul-Aug 2025)
# Though it's back, and d:\ seems to be faster than c:\
# Note that we mount the d:\d.vhdx under c:\d but it'll still use d:\
VHDX_FILE: d:/d.vhdx
jobs:
otel_sdk_build:
name: build otel_sdk
runs-on: windows-2025
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- name: Install PowerShell profile
run: |
$profileDir = Split-Path -Parent $PROFILE.CurrentUserAllHosts
New-Item -ItemType Directory -Path $profileDir -Force | Out-Null
Copy-Item .github/workflows/pwsh_profile.ps1 $PROFILE.CurrentUserAllHosts -Force
$PROFILE.CurrentUserAllHosts
- run: systeminfo
- run: ls "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC"
- run: Get-ChildItem env:* | Sort-Object -Property Name | Format-Table -AutoSize -Wrap
- run: cmd /c "dir c:\ || echo swallowing errors"
- run: cmd /c "dir d:\ || echo swallowing errors"
- run: choco list
- run: |
choco uninstall --yes `
7zip.install `
ant `
apache-httpd `
aria2 `
awscli `
azcopy10 `
bazel `
bicep `
cmake.install `
composer `
gradle `
imagemagick `
imagemagick.app `
jq `
julia `
kubernetes-cli `
kubernetes-helm `
llvm `
maven `
Minikube `
nginx `
ninja `
nssm `
nuget.commandline `
packer `
php `
pulumi `
R.Project `
rtools `
sbt `
strawberryperl `
swig `
wixtoolset
- run: cmd /c "dir c:\ || echo swallowing errors"
- run: cmd /c "dir d:\ || echo swallowing errors"
- run: cmd /c "copy .github\workflows\winget_settings.json %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json || echo swallowing errors"
- run: winget list --accept-source-agreements --disable-interactivity
- run: cmd /c "winget --info || echo swallowing errors"
- run: |
winget remove --all --verbose --force --purge --disable-interactivity `
Amazon.SAM-CLI `
Amazon.SessionManagerPlugin `
Anaconda.Miniconda3 `
Google.Chrome `
Microsoft.Azure.CosmosEmulator `
Microsoft.AzureCLI `
Microsoft.msodbcsql.17 `
Microsoft.ServiceFabricSDK `
Microsoft.WebDeploy `
Microsoft.webpicmd `
Microsoft.WindowsApplicationDriver `
MongoDB.Server `
MongoDB.Shell `
Mozilla.Firefox `
OpenJS.NodeJS.LTS `
PostgreSQL.PostgreSQL.17 `
ShiningLight.OpenSSL.Dev `
Unity.UnityHub
echo Done! LASTEXITCODE=$LASTEXITCODE
- run: winget list --accept-source-agreements --disable-interactivity
- run: cmd /c "dir c:\ || echo swallowing errors"
- run: cmd /c "dir d:\ || echo swallowing errors"
- run: winget install bazelisk -r bazel --accept-package-agreements --disable-interactivity --silent
- name: Install LLVM with winget (ignore if already installed)
shell: pwsh
run: |
winget install -e LLVM.LLVM -v 21.1.3 --accept-package-agreements --disable-interactivity --silent
if ($LASTEXITCODE -ne 0) {
Write-Host "Winget install failed or not needed (already installed)"
exit 0
}
- uses: actions/cache/restore@v4
with:
path: ${{ env.VHDX_FILE }}
enableCrossOsArchive: true
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel', 'MODULE.bazel.lock') }}
restore-keys: ${{ runner.os }}-bazel-
- name: mount cache disk
run: |
New-Item -Path c:/d -ItemType "directory" -Force -Verbose
If (-not(Test-Path ${{ env.VHDX_FILE }})) {
$vhd = New-VHD -Path ${{ env.VHDX_FILE }} -SizeBytes 137438953472 -Dynamic -LogicalSectorSizeBytes 4096 -PhysicalSectorSizeBytes 4096 -Verbose
$vhd
$mnt = Mount-VHD -Path $vhd.path -NoDriveLetter -Verbose -PassThru | Out-Host
$mnt
$disk = Get-VHD -Path $vhd.path -Verbose
$disk
Initialize-Disk $disk.Number -Verbose
$part = New-Partition -DiskNumber $disk.Number -UseMaximumSize -Verbose
$part
$vol = Format-Volume -FileSystem ReFS -Partition $part -Verbose
$vol
Dismount-VHD -Path ${{ env.VHDX_FILE }} -Verbose
}
$part = Mount-VHD -Path ${{ env.VHDX_FILE }} -NoDriveLetter -Verbose -PassThru | Get-Disk | Get-Partition | Where-Object -Not IsHidden
$part
$part | Add-PartitionAccessPath -AccessPath c:/d -Verbose
ls ${{ env.VHDX_FILE }}
echo empty > c:\d\empty.txt
cmd /c "dir c:\d || echo swallowing errors"
# refsutil dedup c:\d /s
- name: build minimal otel_sdk
# On the CI, the github runner does not have constant vs2022 msvc release, but has the same vs2019 (14.29.30133)
# echo "build:windows --action_env=BAZEL_VC_FULL_VERSION=14.29.30133" >> ../top.bazelrc
# echo "build:windows --host_action_env=BAZEL_VC_FULL_VERSION=14.42.34438" >> ../top.bazelrc
run: |
echo "common --remote_download_minimal" >> ../top.bazelrc
echo "build --disk_cache=c:/d" >> ../top.bazelrc
echo "common --repository_cache=d:/r" >> ../top.bazelrc
echo "startup --output_user_root=d:/b" >> ../top.bazelrc
./otel_sdk_build.cmd minimal
./otel_sdk_build.cmd shutdown
- run: |
cmd /c "dir c:\ || echo swallowing errors"
cmd /c "dir d:\ || echo swallowing errors"
cmd /c "dir c:\d || echo swallowing errors"
Dismount-VHD -Path "${{ env.VHDX_FILE }}" -Verbose
ls ${{ env.VHDX_FILE }}
Resize-VHD -Path "${{ env.VHDX_FILE }}" -ToMinimumSize -Verbose -ErrorAction SilentlyContinue
ls ${{ env.VHDX_FILE }}
- uses: actions/cache/save@v4
# Don't update cache on releases
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
env:
ZSTD_CLEVEL: 1 # 1 (fastest) .. 19 (slowest)
with:
path: ${{ env.VHDX_FILE }}
enableCrossOsArchive: true
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel', 'MODULE.bazel.lock') }}
- run: Mount-VHD -Path "${{ env.VHDX_FILE }}" -NoDriveLetter -Verbose -PassThru | Out-Host
- uses: actions/upload-artifact@v4
with:
name: tracing-profiles
path: ./*.tracing.json
if-no-files-found: warn
- run: ./otel_sdk_build.cmd test
- run: cmd /c "dir c:\ || echo swallowing errors"
- run: cmd /c "dir d:\ || echo swallowing errors"
- run: ./otel_sdk_build.cmd zip
- run: ./otel_sdk_build.cmd shutdown
- run: cmd /c "dir c:\ || echo swallowing errors"
- run: cmd /c "dir d:\ || echo swallowing errors"
- run: ls ${{ env.VHDX_FILE }}
- uses: actions/upload-artifact@v4
if: ${{ ! startsWith(github.ref, 'refs/tags/') }}
with:
name: sdk
path: ./otel_sdk.zip
if-no-files-found: warn
- name: release otel_sdk.zip
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: ncipollo/release-action@v1
with: # skipping as test nodll ./0.nodll.tracing.json
artifacts: |
./otel_sdk.zip
./1.all.tracing.json
./2.dbg.tracing.json
./3.fastbuild.tracing.json
./4.opt.tracing.json
./5.pkg.tracing.json