gh-110793: Add CI job that runs tests with an installed build (#152664) · python/cpython@8a4ee5c

GitHub

GitHub CopilotWrite better code with AI | MCP RegistryIntegrate external tools | ActionsAutomate any workflow | CodespacesInstant dev environments | IssuesPlan and track work | Code ReviewManage code changes | Code QualityEnforce quality at merge | Why GitHub | Marketplace | View all features | Enterprises | Small and medium teams | Startups | View all use cases | View all industries | View all solutions | AI | Software Development | DevOps | Security | View all topics | Customer stories | Events & webinars | Ebooks & reports | Business insights | Trust center | Partners | View all resources

Original file line numberDiff line numberDiff line change@@ -245,6 +245,12 @@ jobs:

245245os: ${{ matrix.os }}

246246test-opts: ${{ matrix.test-opts || '' }}

247247248+build-ubuntu-installed:

249+name: 'Ubuntu (installed)'

250+needs: build-context

251+if: needs.build-context.outputs.run-ubuntu == 'true'

252+uses: ./.github/workflows/reusable-install.yml

253+248254build-ubuntu-ssltests:

249255name: 'Ubuntu SSL tests'

250256runs-on: ${{ matrix.os }}

@@ -636,6 +642,7 @@ jobs:

636642 - build-windows

637643 - build-macos

638644 - build-ubuntu

645+ - build-ubuntu-installed

639646 - build-ubuntu-ssltests

640647 - build-ios

641648 - build-emscripten

@@ -685,6 +692,7 @@ jobs:

685692 !fromJSON(needs.build-context.outputs.run-ubuntu)

686693 && '

687694 build-ubuntu,

695+ build-ubuntu-installed,

688696 build-ubuntu-ssltests,

689697 test-hypothesis,

690698 build-asan,

Original file line numberDiff line numberDiff line change@@ -0,0 +1,44 @@

1+name: Reusable Ubuntu (installed)

2+3+on:

4+workflow_call:

5+6+permissions:

7+contents: read

8+9+env:

10+FORCE_COLOR: 1

11+12+jobs:

13+build-install-test:

14+name: build, install and test

15+runs-on: ubuntu-26.04-arm

16+timeout-minutes: 60

17+env:

18+PYTHONSTRICTEXTENSIONBUILD: 1

19+steps:

20+ - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0

21+with:

22+persist-credentials: false

23+ - name: Register gcc problem matcher

24+run: echo "::add-matcher::.github/problem-matchers/gcc.json"

25+ - name: Set install dir

26+run:

27+echo "INSTALL_DIR=$(realpath "${GITHUB_WORKSPACE}/../installed-python")" >> "$GITHUB_ENV"

28+ - name: Install dependencies

29+run: sudo ./.github/workflows/posix-deps-apt.sh

30+ - name: Configure CPython

31+run: ./configure --config-cache --prefix="$INSTALL_DIR"

32+ - name: Build CPython

33+run: make -j

34+ - name: Install CPython

35+run: make install

36+ - name: Set installed interpreter

37+run: |

38+ ldversion=$(./python -c 'import sysconfig; print(sysconfig.get_config_var("LDVERSION"))')

39+ echo "INSTALLED_PYTHON=${INSTALL_DIR}/bin/python${ldversion}" >> "$GITHUB_ENV"

40+ - name: Display build info

41+run: |

42+ "$INSTALLED_PYTHON" -m test.pythoninfo

43+ - name: Test the installed Python

44+run: xvfb-run "$INSTALLED_PYTHON" -m test --fast-ci --timeout=900