Skip to content

Commit 68e1d39

Browse files
committed
CI: actually run with Cygwin Python
Cygwin was installed but the regular Python interpreter was actually used to run the test. Fix this. Also merge Cygwin tests setup definition with the one for other environments.
1 parent 6f16664 commit 68e1d39

File tree

2 files changed

+72
-54
lines changed

2 files changed

+72
-54
lines changed

.github/workflows/tests-cygwin.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,78 @@ jobs:
6161
env_vars: PYTHON
6262
name: ${{ matrix.python }}
6363

64+
cygwin:
65+
runs-on: windows-latest
66+
env:
67+
FORCE_COLOR: true
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
python:
72+
- '3.9'
73+
74+
steps:
75+
- name: Checkout
76+
uses: actions/checkout@v2
77+
78+
- name: Setup Cygwin
79+
uses: cygwin/cygwin-install-action@v2
80+
with:
81+
packages: >-
82+
python39
83+
python39-pip
84+
cmake
85+
gcc-core
86+
gcc-g++
87+
git
88+
make
89+
ninja
90+
91+
- name: Fix git dubious ownership
92+
# This addresses the "fatal: detected dubious ownership in
93+
# repository" and "fatal: not in a git directory" errors
94+
# encountered when trying to run Cygwin git in a directory not
95+
# owned by the current user. This happens when the tests run
96+
# Cygwin git in a directory outside the Cygwin filesystem.
97+
run: git config --global --add safe.directory '*'
98+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
99+
100+
- name: Get pip cache path
101+
id: pip-cache-path
102+
run: echo "path=$(cygpath -w $(python -m pip cache dir))" >> $GITHUB_OUTPUT
103+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
104+
105+
- name: Restore cache
106+
# Cygwin Python cannot use binary wheels from PyPI. Building
107+
# some dependencies takes considerable time. Caching the built
108+
# wheels speeds up the CI job quite a bit.
109+
uses: actions/cache@v3
110+
with:
111+
path: ${{ steps.pip-cache-path.outputs.path }}
112+
key: cygwin-pip-${{ github.sha }}
113+
restore-keys: cygwin-pip-
114+
115+
- name: Install
116+
run: python -m pip --disable-pip-version-check install .[test]
117+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
118+
119+
- name: Run tests
120+
run: >-
121+
python -m pytest --showlocals -vv --cov
122+
--cov-config setup.cfg
123+
--cov-report=xml:coverage-${{ matrix.python }}.xml
124+
shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0}
125+
126+
- name: Send coverage report
127+
uses: codecov/codecov-action@v1
128+
if: ${{ always() }}
129+
env:
130+
PYTHON: cygwin-${{ matrix.python }}
131+
with:
132+
flags: tests
133+
env_vars: PYTHON
134+
name: cygwin-${{ matrix.python }}
135+
64136
pyston:
65137
runs-on: ubuntu-20.04
66138
env:

0 commit comments

Comments
 (0)