Merge pull request #297 from open-telemetry/main #728
This file contains hidden or 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: 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: choco uninstall bazel --yes | |
| - uses: Cyberboss/install-winget@6f566e9e227561d5d31e45d65f9b777b3fa8f56f | |
| - run: winget list --accept-source-agreements --disable-interactivity | |
| - run: winget install bazelisk -r bazel --accept-package-agreements --disable-interactivity --silent | |
| - run: winget install -e LLVM.LLVM -v 20.1.4 --accept-package-agreements --disable-interactivity --silent || echo swalloing errors | |
| - 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: 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) | |
| run: | | |
| 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 | |
| echo "common --remote_download_minimal" >> ../top.bazelrc | |
| 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 minimal | |
| ./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/') }} | |
| env: | |
| ZSTD_CLEVEL: 1 # 1 (fastest) .. 19 (slowest) | |
| 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 | |
| - run: ./otel_sdk_build.cmd test | |
| - run: ./otel_sdk_build.cmd zip | |
| - run: ./otel_sdk_build.cmd shutdown | |
| - run: 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 |