summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0dminnimda <0dminnimda@gmail.com>2022-07-28 08:58:59 +0300
committerGitHub <noreply@github.com>2022-07-28 07:58:59 +0200
commit64701f6e89ab04d2253c3dea38d8ab1cc008e35d (patch)
treeebc152db502098f6fcf0531f83a851a7a878fccc
parente9d5959e1d760d61462bd24477c5fbb457f4212a (diff)
downloadcython-64701f6e89ab04d2253c3dea38d8ab1cc008e35d.tar.gz
Add GitHub Actions build jobs for Windows (GH-4324)
There are still test failures, but at least it allows us to see the test results in GHA.
-rw-r--r--.github/workflows/ci.yml93
-rw-r--r--.gitignore1
-rw-r--r--Tools/ci-run.sh13
-rwxr-xr-xruntests.py3
-rw-r--r--test-requirements-27.txt2
-rw-r--r--test-requirements-34.txt2
-rw-r--r--tests/windows_bugs_39.txt3
7 files changed, 74 insertions, 43 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index a8db37d71..4c2193c5d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,7 +23,7 @@ jobs:
#
# FIXME: 'cpp' tests seems to fail due to compilation errors (numpy_pythran_unit)
# in all python versions and test failures (builtin_float) in 3.5<
- os: [ubuntu-18.04]
+ os: [windows-2019, ubuntu-18.04]
backend: [c, cpp]
python-version:
- "2.7"
@@ -145,12 +145,15 @@ jobs:
python-version: pypy-3.7
backend: c
env: { NO_CYTHON_COMPILE: 1 }
- # Coverage - Disabled due to taking too long to run
- # - os: ubuntu-18.04
- # python-version: 3.7
- # backend: "c,cpp"
- # env: { COVERAGE: 1 }
- # extra_hash: '-coverage'
+ # Coverage
+ - os: ubuntu-18.04
+ python-version: 3.8
+ backend: "c,cpp"
+ env: { COVERAGE: 1 }
+ extra_hash: '-coverage'
+
+ - os: windows-2019
+ allowed_failure: true
# MacOS sub-jobs
# ==============
@@ -196,15 +199,27 @@ jobs:
backend: cpp
env: { MACOSX_DEPLOYMENT_TARGET: 10.14 }
+ exclude:
+ # fails due to lack of a compatible compiler
+ - os: windows-2019
+ python-version: 2.7
+ - os: windows-2019
+ python-version: 3.4
+
+ # cpp specific test fails
+ - os: windows-2019
+ python-version: 3.5
+ backend: cpp
+
+
# This defaults to 360 minutes (6h) which is way too long and if a test gets stuck, it can block other pipelines.
- # From testing, the runs tend to take ~20/~30 minutes, so a limit of 40 minutes should be enough. This can always be
- # changed in the future if needed.
- timeout-minutes: 40
+ # From testing, the runs tend to take ~20 minutes for ubuntu / macos and ~40 for windows,
+ # so a limit of 50 minutes should be enough. This can always be changed in the future if needed.
+ timeout-minutes: 50
runs-on: ${{ matrix.os }}
env:
BACKEND: ${{ matrix.backend }}
- OS_NAME: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
GCC_VERSION: 8
USE_CCACHE: 1
@@ -277,31 +292,31 @@ jobs:
name: pycoverage_html
path: coverage-report-html
-# cycoverage:
-# runs-on: ubuntu-18.04
-#
-# env:
-# BACKEND: c,cpp
-# OS_NAME: ubuntu-18.04
-# PYTHON_VERSION: 3.9
-#
-# steps:
-# - name: Checkout repo
-# uses: actions/checkout@v2
-# with:
-# fetch-depth: 1
-#
-# - name: Setup python
-# uses: actions/setup-python@v2
-# with:
-# python-version: 3.9
-#
-# - name: Run Coverage
-# env: { COVERAGE: 1 }
-# run: bash ./Tools/ci-run.sh
-#
-# - name: Upload Coverage Report
-# uses: actions/upload-artifact@v2
-# with:
-# name: cycoverage_html
-# path: coverage-report-html
+ cycoverage:
+ runs-on: ubuntu-18.04
+
+ env:
+ BACKEND: c,cpp
+ OS_NAME: ubuntu-18.04
+ PYTHON_VERSION: 3.9
+
+ steps:
+ - name: Checkout repo
+ uses: actions/checkout@v2
+ with:
+ fetch-depth: 1
+
+ - name: Setup python
+ uses: actions/setup-python@v2
+ with:
+ python-version: 3.9
+
+ - name: Run Coverage
+ env: { COVERAGE: 1 }
+ run: bash ./Tools/ci-run.sh
+
+ - name: Upload Coverage Report
+ uses: actions/upload-artifact@v2
+ with:
+ name: cycoverage_html
+ path: coverage-report-html
diff --git a/.gitignore b/.gitignore
index deb4c6fce..979aa41e1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
*.pyc
+*.pyd
*.pyo
__pycache__
*.so
diff --git a/Tools/ci-run.sh b/Tools/ci-run.sh
index 4309fd4ad..da6a87c1c 100644
--- a/Tools/ci-run.sh
+++ b/Tools/ci-run.sh
@@ -108,7 +108,16 @@ export PATH="/usr/lib/ccache:$PATH"
# Most modern compilers allow the last conflicting option
# to override the previous ones, so '-O0 -O3' == '-O3'
# This is true for the latest msvc, gcc and clang
-CFLAGS="-O0 -ggdb -Wall -Wextra"
+if [[ $OSTYPE == "msys" ]]; then # for MSVC cl
+ # /wd disables warnings
+ # 4711 warns that function `x` was selected for automatic inline expansion
+ # 4127 warns that a conditional expression is constant, should be fixed here https://github.com/cython/cython/pull/4317
+ # (off by default) 5045 warns that the compiler will insert Spectre mitigations for memory load if the /Qspectre switch is specified
+ # (off by default) 4820 warns about the code in Python\3.9.6\x64\include ...
+ CFLAGS="-Od /Z7 /W4 /wd4711 /wd4127 /wd5045 /wd4820"
+else
+ CFLAGS="-O0 -ggdb -Wall -Wextra"
+fi
if [[ $NO_CYTHON_COMPILE != "1" && $PYTHON_VERSION != "pypy"* ]]; then
@@ -141,7 +150,7 @@ fi
if [[ $TEST_CODE_STYLE == "1" ]]; then
make -C docs html || exit 1
-elif [[ $PYTHON_VERSION != "pypy"* ]]; then
+elif [[ $PYTHON_VERSION != "pypy"* && $OSTYPE != "msys" ]]; then
# Run the debugger tests in python-dbg if available
# (but don't fail, because they currently do fail)
PYTHON_DBG=$(python -c 'import sys; print("%d.%d" % sys.version_info[:2])')
diff --git a/runtests.py b/runtests.py
index 426831a47..a3bd397da 100755
--- a/runtests.py
+++ b/runtests.py
@@ -2706,7 +2706,8 @@ def runtests(options, cmd_args, coverage=None):
('graal_bugs.txt', IS_GRAAL),
('limited_api_bugs.txt', options.limited_api),
('windows_bugs.txt', sys.platform == 'win32'),
- ('cygwin_bugs.txt', sys.platform == 'cygwin')
+ ('cygwin_bugs.txt', sys.platform == 'cygwin'),
+ ('windows_bugs_39.txt', sys.platform == 'win32' and sys.version_info[:2] == (3, 9))
]
exclude_selectors += [
diff --git a/test-requirements-27.txt b/test-requirements-27.txt
index a3ad0439e..efec3bbbf 100644
--- a/test-requirements-27.txt
+++ b/test-requirements-27.txt
@@ -26,6 +26,7 @@ jupyter-console==5.2.0
jupyter-core==4.6.3
line-profiler==3.1.0
MarkupSafe==1.1.1
+maturin==0.7.6; os_name == "nt" # actually 0.9.4, but it's not available; pywinpty dependency
mistune==0.8.4
nbconvert==5.6.1
nbformat==4.4.0
@@ -44,6 +45,7 @@ Pygments==2.5.2
pyparsing==2.4.7
pyrsistent==0.15.7
python-dateutil==2.8.1
+pywinpty==0.5.7 # terminado dependency (pywinpty>=0.5)
pyzmq==16.0.4
qtconsole==4.7.7
QtPy==1.9.0
diff --git a/test-requirements-34.txt b/test-requirements-34.txt
index 8697eff4b..8a48d1ae6 100644
--- a/test-requirements-34.txt
+++ b/test-requirements-34.txt
@@ -1,3 +1,3 @@
-numpy < 1.19.0
+numpy<1.16.0
coverage
pycodestyle
diff --git a/tests/windows_bugs_39.txt b/tests/windows_bugs_39.txt
new file mode 100644
index 000000000..6b56b9d33
--- /dev/null
+++ b/tests/windows_bugs_39.txt
@@ -0,0 +1,3 @@
+# https://github.com/cython/cython/issues/3450
+TestInline
+scanner_trace