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.
CI: test the build and add some mingw specific tests
- Loading branch information
1 parent
4ad86b7
commit dace5a0
Showing
3 changed files
with
553 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,209 @@ | ||
name: Build | ||
on: [push, pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-2022 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
msystem: ['MINGW64','MINGW32','UCRT64','CLANG64'] | ||
include: | ||
- msystem: MINGW64 | ||
prefix: mingw-w64-x86_64 | ||
- msystem: MINGW32 | ||
prefix: mingw-w64-i686 | ||
- msystem: UCRT64 | ||
prefix: mingw-w64-ucrt-x86_64 | ||
- msystem: CLANG64 | ||
prefix: mingw-w64-clang-x86_64 | ||
#- msystem: CLANG32 | ||
# prefix: mingw-w64-clang-i686 | ||
steps: | ||
- name: Setup git | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
- uses: actions/checkout@v2 | ||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: ${{ matrix.msystem }} | ||
release: false | ||
update: true | ||
install: >- | ||
make | ||
binutils | ||
autoconf | ||
autoconf-archive | ||
automake-wrapper | ||
tar | ||
gzip | ||
${{ matrix.prefix }}-toolchain | ||
${{ matrix.prefix }}-expat | ||
${{ matrix.prefix }}-bzip2 | ||
${{ matrix.prefix }}-libffi | ||
${{ matrix.prefix }}-mpdecimal | ||
${{ matrix.prefix }}-ncurses | ||
${{ matrix.prefix }}-openssl | ||
${{ matrix.prefix }}-sqlite3 | ||
${{ matrix.prefix }}-tcl | ||
${{ matrix.prefix }}-tk | ||
${{ matrix.prefix }}-zlib | ||
${{ matrix.prefix }}-xz | ||
${{ matrix.prefix }}-tzdata | ||
- name: Build Python | ||
shell: msys2 {0} | ||
run: | | ||
set -ex | ||
if [ ${{ matrix.msystem }} == "CLANG64" ] | ||
then | ||
export CC=clang | ||
export CXX=clang++ | ||
fi | ||
autoreconf -vfi | ||
rm -Rf _build && mkdir _build && cd _build | ||
../configure \ | ||
--prefix=${MINGW_PREFIX} \ | ||
--host=${MINGW_CHOST} \ | ||
--build=${MINGW_CHOST} \ | ||
--enable-shared \ | ||
--with-system-expat \ | ||
--with-system-ffi \ | ||
--with-system-libmpdec \ | ||
--without-ensurepip \ | ||
--without-c-locale-coercion \ | ||
--enable-loadable-sqlite-extensions \ | ||
--with-tzpath=${MINGW_PREFIX}/share/zoneinfo \ | ||
--enable-optimizations | ||
make -j8 | ||
- name: Run Smoke Test (build) | ||
shell: msys2 {0} | ||
run: | | ||
SMOKETESTS="$(pwd)/mingw_smoketests.py" | ||
cd _build | ||
./python.exe "$SMOKETESTS" | ||
MSYSTEM= ./python.exe "$SMOKETESTS" | ||
- name: Run tests | ||
shell: msys2 {0} | ||
run: | | ||
IGNOREFILE="$(pwd)/mingw_ignorefile.txt" | ||
cd _build | ||
MSYSTEM= ./python.exe -m test -j8 --ignorefile "$IGNOREFILE" -W | ||
- name: Run broken tests | ||
continue-on-error: true | ||
shell: msys2 {0} | ||
run: | | ||
IGNOREFILE="$(pwd)/mingw_ignorefile.txt" | ||
cd _build | ||
MSYSTEM= ./python.exe -m test -j8 --matchfile "$IGNOREFILE" -W | ||
- name: Install | ||
shell: msys2 {0} | ||
run: | | ||
set -ex | ||
cd _build | ||
pkgdir=python_pkgdir | ||
make -j1 install DESTDIR="${pkgdir}" | ||
# Fix shebangs | ||
_pybasever=$(./python.exe -c "import sys; print(sys.winver);") | ||
for fscripts in 2to3 2to3-${_pybasever} idle3 idle${_pybasever} pydoc3 pydoc${_pybasever}; do | ||
sed -i "s|$(cygpath -w ${MINGW_PREFIX} | sed 's|\\|\\\\|g')/bin/python${_pybasever}.exe|/usr/bin/env python${_pybasever}.exe|g" "${pkgdir}${MINGW_PREFIX}"/bin/${fscripts} | ||
done | ||
sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${_pybasever}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${_pybasever}/python-config.py | ||
# Create version-less aliases | ||
cp "${pkgdir}${MINGW_PREFIX}"/bin/python3.exe "${pkgdir}${MINGW_PREFIX}"/bin/python.exe | ||
cp "${pkgdir}${MINGW_PREFIX}"/bin/python3w.exe "${pkgdir}${MINGW_PREFIX}"/bin/pythonw.exe | ||
cp "${pkgdir}${MINGW_PREFIX}"/bin/python3-config "${pkgdir}${MINGW_PREFIX}"/bin/python-config | ||
cp "${pkgdir}${MINGW_PREFIX}"/bin/idle3 "${pkgdir}${MINGW_PREFIX}"/bin/idle | ||
cp "${pkgdir}${MINGW_PREFIX}"/bin/pydoc3 "${pkgdir}${MINGW_PREFIX}"/bin/pydoc | ||
- name: Run Smoke Test (installed) | ||
shell: msys2 {0} | ||
run: | | ||
export PYTHONTZPATH="${MINGW_PREFIX}/share/zoneinfo" | ||
SMOKETESTS="$(pwd)/mingw_smoketests.py" | ||
cd _build | ||
cd python_pkgdir/${MINGW_PREFIX}/bin | ||
./python.exe "$SMOKETESTS" | ||
MSYSTEM= ./python.exe "$SMOKETESTS" | ||
- name: Compress | ||
if: always() | ||
shell: msys2 {0} | ||
run: | | ||
cd _build | ||
tar -zcf python.tar.gz python_pkgdir/ | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
if: always() | ||
with: | ||
name: build-${{ matrix.msystem }} | ||
path: _build/python.tar.gz | ||
|
||
cross: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: archlinux:base-devel | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install deps | ||
run: | | ||
pacman --noconfirm -Suuy | ||
pacman --needed --noconfirm -S mingw-w64-gcc autoconf-archive autoconf automake python zip | ||
- name: Build | ||
run: | | ||
autoreconf -vfi | ||
mkdir _build && cd _build | ||
../configure \ | ||
--host=x86_64-w64-mingw32 \ | ||
--build=x86_64-pc-linux-gnu \ | ||
--enable-shared \ | ||
--with-system-expat \ | ||
--with-system-ffi \ | ||
--with-system-libmpdec \ | ||
--without-ensurepip \ | ||
--without-c-locale-coercion \ | ||
--enable-loadable-sqlite-extensions | ||
make -j8 | ||
make install DESTDIR="$(pwd)/install" | ||
- name: 'Zip files' | ||
run: | | ||
zip -r install.zip _build/install | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-cross | ||
path: install.zip | ||
|
||
cross-test: | ||
needs: [cross] | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: build-cross | ||
|
||
- name: 'Run tests' | ||
run: | | ||
7z x install.zip | ||
./_build/install/usr/local/bin/python3.exe -c "import sysconfig, pprint; pprint.pprint(sysconfig.get_config_vars())" |
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,34 @@ | ||
ctypes.test.test_loading.LoaderTest.test_load_dll_with_flags | ||
distutils.tests.test_bdist_dumb.BuildDumbTestCase.test_simple_built | ||
distutils.tests.test_cygwinccompiler.CygwinCCompilerTestCase.test_get_versions | ||
distutils.tests.test_util.UtilTestCase.test_change_root | ||
test.datetimetester.TestLocalTimeDisambiguation_Fast.* | ||
test.datetimetester.TestLocalTimeDisambiguation_Pure.* | ||
test.test_cmath.CMathTests.test_specific_values | ||
test.test_cmd_line_script.CmdLineTest.test_consistent_sys_path_for_direct_execution | ||
test.test_compileall.CommandLineTestsNoSourceEpoch.* | ||
test.test_compileall.CommandLineTestsWithSourceEpoch.* | ||
test.test_compileall.CompileallTestsWithoutSourceEpoch.* | ||
test.test_compileall.CompileallTestsWithSourceEpoch.* | ||
test.test_import.ImportTests.test_dll_dependency_import | ||
test.test_math.MathTests.* | ||
test.test_ntpath.NtCommonTest.test_import | ||
test.test_os.StatAttributeTests.test_stat_block_device | ||
test.test_os.TestScandir.test_attributes | ||
test.test_os.UtimeTests.test_large_time | ||
test.test_platform.PlatformTest.test_architecture_via_symlink | ||
test.test_regrtest.ProgramsTestCase.test_pcbuild_rt | ||
test.test_regrtest.ProgramsTestCase.test_tools_buildbot_test | ||
test.test_site._pthFileTests.* | ||
test.test_site.HelperFunctionsTests.* | ||
test.test_site.StartupImportTests.* | ||
test.test_ssl.* | ||
test.test_strptime.CalculationTests.* | ||
test.test_strptime.StrptimeTests.test_weekday | ||
test.test_strptime.TimeRETests.test_compile | ||
test.test_tools.test_i18n.Test_pygettext.test_POT_Creation_Date | ||
test.test_venv.BasicTest.* | ||
test.test_venv.EnsurePipTest.* | ||
# flaky | ||
test.test__xxsubinterpreters.* | ||
test.test_asyncio.test_subprocess.SubprocessProactorTests.test_stdin_broken_pipe |
Oops, something went wrong.