forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes python#127432 Add CI test for cross-builds. * Add a new test function `test_cross_build` in `Lib/test/test_embed.py` to run `test_sysconfig`, `test_site`, and `test_embed` tests. * Use `subprocess` to run the tests in the build directory and after installation. * Add a new workflow file `.github/workflows/cross-build.yml` to define the CI test for cross-builds. * Include steps to build a host Python, install it, configure a new build, and run the tests. * Run the tests in the build directory and after installation. * Use a different architecture in the cross-build. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/python/cpython/issues/127432?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
1 parent
49f15d8
commit 7aa74e3
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Cross-Builds | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
cross-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: sudo apt-get install -y build-essential | ||
|
||
- name: Build host Python | ||
run: | | ||
./configure --prefix=$PWD/workdir/host-python | ||
make -j4 | ||
make install | ||
- name: Configure cross-build | ||
run: | | ||
./configure --with-build-python=$PWD/workdir/host-python/bin/python --prefix=$PWD/workdir/cross-python | ||
make -j4 | ||
- name: Run tests in build directory | ||
run: ./python -m test test_sysconfig test_site test_embed | ||
|
||
- name: Install cross-build | ||
run: make install | ||
|
||
- name: Run tests with installed Python | ||
run: $PWD/workdir/cross-python/bin/python -m test test_sysconfig test_site test_embed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters