Merge pull request #53 from open-telemetry/main #255
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
jobs: | |
otel_sdk_build: | |
name: build otel_sdk | |
runs-on: windows-latest | |
permissions: | |
contents: write | |
steps: | |
- run: systeminfo | |
- run: Get-ChildItem env:* | Sort-Object -Property Name | Format-Table -AutoSize -Wrap | |
- uses: Cyberboss/install-winget@v1 | |
- run: winget install LLVM.LLVM --version 18.1.8 --silent --accept-package-agreements --accept-source-agreements | |
- uses: actions/checkout@v4 | |
- uses: actions/cache/restore@v4 | |
with: | |
path: d:/d.vhdx | |
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 d:/d -ItemType "directory" -Force -Verbose | |
If (-not(Test-Path d:/d.vhdx)) { | |
$vhd = New-VHD -Path d:/d.vhdx -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 d:/d.vhdx -Verbose | |
} | |
$part = Mount-VHD -Path d:/d.vhdx -NoDriveLetter -Verbose -PassThru | Get-Disk | Get-Partition | Where-Object -Not IsHidden | |
$part | |
$part | Add-PartitionAccessPath -AccessPath d:/d -Verbose | |
ls d:/d.vhdx | |
echo empty > d:\d\empty.txt | |
cmd /c dir d:\d || echo "swallowing errors" | |
refsutil dedup d:\d /s | |
- name: test otel_sdk | |
run: | | |
echo "build --disk_cache=d:/d" >> ../top.bazelrc | |
echo "common --repository_cache=d:/r" >> ../top.bazelrc | |
echo "startup --output_user_root=d:/b" >> ../top.bazelrc | |
./otel_sdk_build.cmd test | |
./otel_sdk_build.cmd shutdown | |
- run: | | |
cmd /c dir d:\d || echo "swallowing errors" | |
Dismount-VHD -Path "d:/d.vhdx" -Verbose | |
ls d:/d.vhdx | |
Resize-VHD -Path "d:/d.vhdx" -ToMinimumSize -Verbose -ErrorAction SilentlyContinue | |
ls d:/d.vhdx | |
- uses: actions/cache/save@v4 | |
# Don't update cache on releases | |
if: ${{ ! startsWith(github.ref, 'refs/tags/') }} | |
with: | |
path: d:/d.vhdx | |
enableCrossOsArchive: true | |
key: ${{ runner.os }}-bazel-${{ hashFiles('.bazelversion', '.bazelrc', 'MODULE.bazel', 'MODULE.bazel.lock') }} | |
- run: Mount-VHD -Path "d:/d.vhdx" -NoDriveLetter -Verbose -PassThru | Out-Host | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: tracing-profiles | |
path: ./*.tracing.json | |
if-no-files-found: warn | |
- name: build otel_sdk.zip | |
run: | | |
./otel_sdk_build.cmd zip | |
./otel_sdk_build.cmd shutdown | |
ls d:/d.vhdx | |
- 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 |