diff --git a/.github/actions/build-python-from-source/action.yml b/.github/actions/build-python-from-source/action.yml index 384b563..dfaa4cc 100644 --- a/.github/actions/build-python-from-source/action.yml +++ b/.github/actions/build-python-from-source/action.yml @@ -48,7 +48,9 @@ runs: git checkout ${{ inputs.python-version }} fi + # Do not rebuild python is we do not need to. - name: Cache Python built artifacts + if: "!contains(inputs.python-version, 'alpha')" uses: actions/cache@v3 id: python-cache with: @@ -133,6 +135,8 @@ runs: # This example shows how to use the Build Python from Source action in a GitHub workflow. # Replace 'your-workflow.yml' with the name of your actual workflow file. # +# Note: if the python version has alpha in it then we clone the tip of main and do not cache. +# # .github/workflows/your-workflow.yml # jobs: # build: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a482d1..7f43441 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,11 +83,12 @@ jobs: # action os set it here for consistency if not building from source. - name: Set LOCAL_PYTHON envvar if: matrix.build-from-source == false - run: echo "LOCAL_PYTHON=python" >> $GITHUB_ENV shell: bash + run: echo "LOCAL_PYTHON=python" >> $GITHUB_ENV # Upgrade pip to the latest version. - name: Upgrade pip + shell: bash run: | $LOCAL_PYTHON -m pip install --upgrade pip @@ -98,11 +99,13 @@ jobs: # Install dependencies required for building and testing. - name: Install dependencies + shell: bash run: | $LOCAL_PYTHON -m pip install --upgrade setuptools wheel # Build the wheel package with or without nogil suffix. - name: Build + shell: bash run: | $LOCAL_PYTHON -P setup.py bdist_wheel #if [ "${{ matrix.build-from-source }}" = "true" ]; then @@ -112,17 +115,17 @@ jobs: # mv "$file" "${file%.whl}_nogil.whl" #done #fi - shell: bash # Install the built wheel package so we can test it. - name: Install wheel + shell: bash run: | $LOCAL_PYTHON -m pip install build/dist/*.whl - shell: bash working-directory: ${{github.workspace}} # Run all the tests and benchmarks. - name: Test + shell: bash run: | mkdir test_dir cd test_dir