From 2b68ae9c845a52f9d09d89ad16a1ed72d3e75e03 Mon Sep 17 00:00:00 2001 From: Alex Turner Date: Tue, 15 Oct 2024 07:28:55 -0700 Subject: [PATCH] Add python source build --- .github/actions/build-python-from-source/action.yml | 10 ++++++---- .github/workflows/build.yml | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/actions/build-python-from-source/action.yml b/.github/actions/build-python-from-source/action.yml index 8ea4904..2024af4 100644 --- a/.github/actions/build-python-from-source/action.yml +++ b/.github/actions/build-python-from-source/action.yml @@ -36,9 +36,11 @@ runs: choco install --quiet --no-progress openssl fi + # We do not need to keep building python from source if it is against a tag which is therefore + # unchanging. - name: Cache the entire checkout and build. if: "!contains(inputs.python-version, 'alpha')" - uses: actions/cache@v3 + uses: actions/cache/restore@v3 id: cpython-cache with: path: ${github.workspace}/cpython @@ -90,14 +92,14 @@ runs: ./PCbuild/build.bat -e $configure_options fi - # Update/create the cache. + # Update/create the cache. We force this so even if later parts of the workflow fail + # we do not need to keep rebuilding a headlthy vesion of the python system. - name: Cache Python build if: "!contains(inputs.python-version, 'alpha')" - uses: actions/cache@v3 + uses: actions/cache/save@v3 with: path: ${github.workspace}/cpython key: ${{ runner.os }}-python-${{ inputs.python-version }}-${{ inputs.nogil }} - restore-keys: ${{ runner.os }}-python-${{ inputs.python-version }}-${{ inputs.nogil }} # Install the built Python version. - name: Install Python diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7f43441..cd6e23d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,9 +87,10 @@ jobs: run: echo "LOCAL_PYTHON=python" >> $GITHUB_ENV # Upgrade pip to the latest version. - - name: Upgrade pip + - name: Install/Upgrade pip shell: bash run: | + $LOCAL_PYTHON -m ensurepip $LOCAL_PYTHON -m pip install --upgrade pip # Make sure Visual Studio build is all in place on Windows.