From 9a73e26897e629f622955f0ee7ecfa876d30fdb6 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Tue, 30 Jun 2026 11:49:15 +0200 Subject: [PATCH 1/3] gh-110793: Add CI job that runs tests with an installed build --- .github/workflows/build.yml | 8 +++++ .github/workflows/reusable-install.yml | 41 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/reusable-install.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9a956a6bf53038..7099939a64c0676 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -391,6 +391,12 @@ jobs: if: needs.build-context.outputs.run-wasi == 'true' uses: ./.github/workflows/reusable-wasi.yml + build-ubuntu-installed: + name: 'Ubuntu ARM (installed)' + needs: build-context + if: needs.build-context.outputs.run-ubuntu == 'true' + uses: ./.github/workflows/reusable-install.yml + test-hypothesis: name: "Hypothesis tests on Ubuntu" runs-on: ubuntu-24.04 @@ -670,6 +676,7 @@ jobs: - build-ios - build-emscripten - build-wasi + - build-ubuntu-installed - test-hypothesis - build-asan - build-san @@ -717,6 +724,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 000000000000000..18f27a3d05bcd28 --- /dev/null +++ b/.github/workflows/reusable-install.yml @@ -0,0 +1,41 @@ +name: Reusable Ubuntu (Installed) + +on: + workflow_call: + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + +jobs: + build-install-reusable: + name: 'Build, install and test' + runs-on: ubuntu-24.04-arm + 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: Display build info + run: make pythoninfo + - name: Install CPython + run: make install + - name: Test the installed Python + run: xvfb-run "$INSTALL_DIR/bin/python3" -m test -j0 --fast-ci --timeout=900 From caf7b269bf13695ce7cf03252b457c5d6cbb3a56 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Tue, 30 Jun 2026 11:58:14 +0200 Subject: [PATCH 2/3] Pass OS like we do for `reusable-ubunut` --- .github/workflows/build.yml | 4 +++- .github/workflows/reusable-install.yml | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7099939a64c0676..c6a03a64e7aa0b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -392,10 +392,12 @@ jobs: uses: ./.github/workflows/reusable-wasi.yml build-ubuntu-installed: - name: 'Ubuntu ARM (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" diff --git a/.github/workflows/reusable-install.yml b/.github/workflows/reusable-install.yml index 18f27a3d05bcd28..27e85be48cfe6bd 100644 --- a/.github/workflows/reusable-install.yml +++ b/.github/workflows/reusable-install.yml @@ -2,6 +2,11 @@ name: Reusable Ubuntu (Installed) on: workflow_call: + inputs: + os: + description: OS to run the job + required: true + type: string permissions: contents: read @@ -11,8 +16,8 @@ env: jobs: build-install-reusable: - name: 'Build, install and test' - runs-on: ubuntu-24.04-arm + name: build, install and test (${{ inputs.os }}) + runs-on: ${{ inputs.os }} timeout-minutes: 60 env: PYTHONSTRICTEXTENSIONBUILD: 1 From 4d5bbd045dcc1b447d57a4750fc2bbb2f45dedac Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Tue, 30 Jun 2026 12:15:12 +0200 Subject: [PATCH 3/3] Run `pythoninfo` on installed, and run test w/ `python${LDVERSION}` --- .github/workflows/reusable-install.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/reusable-install.yml b/.github/workflows/reusable-install.yml index 27e85be48cfe6bd..102647414f841b4 100644 --- a/.github/workflows/reusable-install.yml +++ b/.github/workflows/reusable-install.yml @@ -38,9 +38,14 @@ jobs: run: ./configure --config-cache --with-pydebug --prefix="$INSTALL_DIR" - name: Build CPython run: make -j - - name: Display build info - run: make pythoninfo - 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 "$INSTALL_DIR/bin/python3" -m test -j0 --fast-ci --timeout=900 + run: xvfb-run "$INSTALLED_PYTHON" -m test -j0 --fast-ci --timeout=900