Skip to content

Commit 99849ee

Browse files
gh-127432: Add CI job to cross build Python (#128380)
Co-authored-by: Filipe Laíns 🇵🇸 <[email protected]>
1 parent c931d75 commit 99849ee

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/build.yml

+39
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,45 @@ jobs:
527527
config_hash: ${{ needs.check_source.outputs.config_hash }}
528528
free-threading: ${{ matrix.free-threading }}
529529

530+
cross-build-linux:
531+
name: Cross build Linux
532+
runs-on: ubuntu-latest
533+
needs: check_source
534+
if: needs.check_source.outputs.run_tests == 'true'
535+
steps:
536+
- uses: actions/checkout@v4
537+
with:
538+
persist-credentials: false
539+
- name: Runner image version
540+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
541+
- name: Restore config.cache
542+
uses: actions/cache@v4
543+
with:
544+
path: config.cache
545+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
546+
- name: Register gcc problem matcher
547+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
548+
- name: Set build dir
549+
run:
550+
# an absolute path outside of the working directoy
551+
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552+
- name: Install Dependencies
553+
run: sudo ./.github/workflows/posix-deps-apt.sh
554+
- name: Configure host build
555+
run: ./configure --prefix="$BUILD_DIR/host-python"
556+
- name: Install host Python
557+
run: make -j8 install
558+
- name: Run test subset with host build
559+
run: |
560+
"$BUILD_DIR/host-python/bin/python3" -m test test_sysconfig test_site test_embed
561+
- name: Configure cross build
562+
run: ./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
563+
- name: Install cross Python
564+
run: make -j8 install
565+
- name: Run test subset with host build
566+
run: |
567+
"$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed
568+
530569
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
531570
cifuzz:
532571
name: CIFuzz

0 commit comments

Comments
 (0)