Add some instrumentation to debug symbol issues in CI. #32
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| release: | |
| types: [created] | |
| jobs: | |
| build: | |
| runs-on: windows-2022 | |
| strategy: | |
| matrix: | |
| platform: [Win32, x64] | |
| configuration: [Debug, Release] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Debugging Tools for Windows | |
| run: | | |
| # TODO: It would be nice if we could use `winget install Microsoft.WinDbg` but it doesn't install to $(WindowsSdkDir)\Debuggers | |
| # As a workaround, directly download and install the Windows SDK's debugging tools feature. | |
| $ProgressPreference = 'SilentlyContinue' | |
| Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?linkid=2361308' -OutFile 'winsdksetup.exe' | |
| $proc = Start-Process -Wait -PassThru -FilePath '.\winsdksetup.exe' -ArgumentList '/features OptionId.WindowsDesktopDebuggers /quiet /norestart' | |
| Remove-Item winsdksetup.exe -ErrorAction SilentlyContinue | |
| if ($proc.ExitCode -ne 0) { exit $proc.ExitCode } | |
| - name: Install Python versions with symbols | |
| run: | | |
| choco install -y --no-progress python2 | |
| choco install -y --no-progress --params "Include_symbols=1" python310 | |
| choco install -y --no-progress --params "Include_symbols=1" python311 | |
| choco install -y --no-progress --params "Include_symbols=1" python312 | |
| choco install -y --no-progress --params "Include_symbols=1" python313 | |
| choco install -y --no-progress --params "Include_symbols=1" python314 | |
| - name: Add MSBuild to PATH | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Build | |
| run: | | |
| msbuild PyExt.sln ` | |
| /p:Configuration=${{ matrix.configuration }} ` | |
| /p:Platform=${{ matrix.platform }} ` | |
| /m ` | |
| /v:minimal | |
| - name: Test | |
| working-directory: test/scripts | |
| run: | | |
| py -3 run_all_tests.py ` | |
| "${{ github.workspace }}/${{ matrix.platform }}/${{ matrix.configuration }}/PyExtTest.exe" | |
| - name: Upload artifact | |
| if: github.event_name == 'release' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: PyExt-${{ matrix.platform }}-${{ matrix.configuration }} | |
| path: | | |
| ${{ matrix.platform }}\${{ matrix.configuration }}\pyext.dll | |
| ${{ matrix.platform }}\${{ matrix.configuration }}\pyext.pdb | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| path: artifacts | |
| - name: Create release zip | |
| run: | | |
| for platform in Win32 x64; do | |
| for config in Debug Release; do | |
| mkdir -p "PyExt/$platform/$config" | |
| cp artifacts/PyExt-$platform-$config/* "PyExt/$platform/$config/" | |
| done | |
| done | |
| zip -r PyExt.zip PyExt/ | |
| - name: Attach artifacts to release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: gh release upload ${{ github.event.release.tag_name }} PyExt.zip |