diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9a956a6bf5303..c6a03a64e7aa0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -391,6 +391,14 @@ jobs: if: needs.build-context.outputs.run-wasi == 'true' uses: ./.github/workflows/reusable-wasi.yml + build-ubuntu-installed: + name: 'Ubuntu (installed)' + needs: build-context + if: needs.build-context.outputs.run-ubuntu == 'true' + uses: ./.github/workflows/reusable-install.yml + with: + os: ubuntu-24.04-arm + test-hypothesis: name: "Hypothesis tests on Ubuntu" runs-on: ubuntu-24.04 @@ -670,6 +678,7 @@ jobs: - build-ios - build-emscripten - build-wasi + - build-ubuntu-installed - test-hypothesis - build-asan - build-san @@ -717,6 +726,7 @@ jobs: && ' build-ubuntu, build-ubuntu-ssltests, + build-ubuntu-installed, test-hypothesis, build-asan, build-san, diff --git a/.github/workflows/reusable-install.yml b/.github/workflows/reusable-install.yml new file mode 100644 index 00000000000000..102647414f841b --- /dev/null +++ b/.github/workflows/reusable-install.yml @@ -0,0 +1,51 @@ +name: Reusable Ubuntu (Installed) + +on: + workflow_call: + inputs: + os: + description: OS to run the job + required: true + type: string + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + +jobs: + build-install-reusable: + name: build, install and test (${{ inputs.os }}) + runs-on: ${{ inputs.os }} + timeout-minutes: 60 + env: + PYTHONSTRICTEXTENSIONBUILD: 1 + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Runner image version + run: echo "IMAGE_OS_VERSION=${ImageOS}-${ImageVersion}" >> "$GITHUB_ENV" + - name: Register gcc problem matcher + run: echo "::add-matcher::.github/problem-matchers/gcc.json" + - name: Set install dir + run: + echo "INSTALL_DIR=$(realpath "${GITHUB_WORKSPACE}/../installed-python")" >> "$GITHUB_ENV" + - name: Install dependencies + run: sudo ./.github/workflows/posix-deps-apt.sh + - name: Configure CPython + run: ./configure --config-cache --with-pydebug --prefix="$INSTALL_DIR" + - name: Build CPython + run: make -j + - name: Install CPython + run: make install + - name: Set installed interpreter + run: | + ldversion=$(./python -c 'import sysconfig; print(sysconfig.get_config_var("LDVERSION"))') + echo "INSTALLED_PYTHON=${INSTALL_DIR}/bin/python${ldversion}" >> "$GITHUB_ENV" + - name: Display build info + run: | + "$INSTALLED_PYTHON" -m test.pythoninfo + - name: Test the installed Python + run: xvfb-run "$INSTALLED_PYTHON" -m test -j0 --fast-ci --timeout=900