From 41f641758a2b7c573ebd5c0c4b56fd24f8b96640 Mon Sep 17 00:00:00 2001 From: Mikhail Koliada Date: Fri, 14 Jan 2022 19:53:00 +0300 Subject: [PATCH] another round of improvements --- .github/workflows/python-builder.yml | 21 ++++++++++----------- builders/python-builder.psm1 | 7 +++++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.github/workflows/python-builder.yml b/.github/workflows/python-builder.yml index 2d274b5..c760321 100644 --- a/.github/workflows/python-builder.yml +++ b/.github/workflows/python-builder.yml @@ -57,7 +57,6 @@ jobs: submodules: true - name: Build Python ${{ env.VERSION }} - shell: pwsh run: | ./builders/build-python.ps1 -Version $env:VERSION ` -Platform ${{ matrix.platform }} -Architecture ${{ matrix.arch }} @@ -120,11 +119,12 @@ jobs: - name: Apply build artifact to the local machine run: | - if ('${{ matrix.platform }}' -eq 'win32') { powershell ./setup.ps1 } else { sh ./setup.sh } - if ('${{ matrix.platform }}' -ne 'win32') { - cp ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}/build_output.txt ${{ runner.temp }} - } - + if ('${{ matrix.platform }}' -eq 'win32') { + powershell ./setup.ps1 + } else { + sh ./setup.sh + cp ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}/build_output.txt ${{ runner.temp }} + } working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }} - name: Setup Python ${{ env.VERSION }} @@ -133,16 +133,15 @@ jobs: python-version: ${{ env.VERSION }} - name: Verbose sysconfig dump - run: | - if ('${{ matrix.platform }}' -ne 'win32') { python ./sources/python-config-output.py } + if: runner.os == 'Linux' || runner.os == 'macOS' + run: python ./sources/python-config-output.py working-directory: ${{ github.workspace }}/tests - name: Verbose python binary links + if: runner.os == 'Linux' || runner.os == 'macOS' run: | $pythonLocation = which python - if ('${{ matrix.platform }}' -ne 'win32') { - if ('${{ matrix.platform }}' -eq 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation } - } + if ('${{ matrix.platform }}' -eq 'darwin') { otool -L $pythonLocation } else { ldd $pythonLocation } - name: Run tests run: | diff --git a/builders/python-builder.psm1 b/builders/python-builder.psm1 index 5c1922e..4151379 100644 --- a/builders/python-builder.psm1 +++ b/builders/python-builder.psm1 @@ -41,8 +41,11 @@ class PythonBuilder { PythonBuilder ([semver] $version, [string] $architecture, [string] $platform) { $this.InstallationTemplatesLocation = Join-Path -Path $PSScriptRoot -ChildPath "../installers" - New-Item -Force -Type Directory (Join-Path $env:RUNNER_TEMP "artifact") - New-Item -Force -Type Directory (Join-Path $env:RUNNER_TEMP "work") + $artifactDirectory = Join-Path $env:RUNNER_TEMP "artifact" + $workDirectory = Join-Path $env:RUNNER_TEMP "work" + + New-Item -Force -Type Directory $artifactDirectory + New-Item -Force -Type Directory $workDirectory $this.HostedToolcacheLocation = $env:RUNNER_TOOL_CACHE $this.TempFolderLocation = $env:RUNNER_TEMP