Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#112 Add windows to github actions #208

Merged
merged 11 commits into from
Mar 28, 2024
25 changes: 21 additions & 4 deletions config/c-code/tests-cache.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,32 @@
# to save the cache. So it must come before the thing we want to use
# the cache.
###
- name: Get pip cache dir
id: pip-cache
- name: Get pip cache dir (default)
id: pip-cache-default
if: ${{ !startsWith(runner.os, 'Windows') }}
run: |
echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT

- name: pip cache
- name: Get pip cache dir (Windows)
id: pip-cache-windows
if: ${{ startsWith(runner.os, 'Windows') }}
run: |
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT

- name: pip cache (default)
uses: actions/cache@v3
if: ${{ !startsWith(runner.os, 'Windows') }}
with:
path: ${{ steps.pip-cache-default.outputs.dir }}
key: %(cache_key)s
restore-keys: |
${{ runner.os }}-pip-

- name: pip cache (Windows)
uses: actions/cache@v3
if: ${{ startsWith(runner.os, 'Windows') }}
with:
path: ${{ steps.pip-cache.outputs.dir }}
path: ${{ steps.pip-cache-windows.outputs.dir }}
key: %(cache_key)s
restore-keys: |
${{ runner.os }}-pip-
2 changes: 1 addition & 1 deletion config/c-code/tests-strategy.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{% if with_future_python %}
- "%(future_python_version)s"
{% endif %}
os: [ubuntu-20.04, macos-11]
os: [ubuntu-20.04, macos-11, windows-latest]
{% if with_pypy or gha_additional_exclude %}
exclude:
{% endif %}
Expand Down
8 changes: 5 additions & 3 deletions config/c-code/tests.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,14 @@ jobs:
run:
{% if gha_test_commands %}
{% for line in gha_test_commands %}
PURE_PYTHON=1 %(line)s
%(line)s
{% endfor %}
{% else %}
# coverage makes PyPy run about 3x slower!
PURE_PYTHON=1 python -m coverage run -p -m zope.testrunner --test-path=src --auto-color --auto-progress
python -m coverage run -p -m zope.testrunner --test-path=src --auto-color --auto-progress
{% endif %}
env:
PURE_PYTHON: 1
- name: Report Coverage
run: |
coverage combine
Expand Down Expand Up @@ -403,7 +405,7 @@ jobs:
path: wheelhouse/*whl
name: manylinux_${{ matrix.image }}_wheels.zip
- name: Restore pip cache permissions
run: sudo chown -R $(whoami) ${{ steps.pip-cache.outputs.dir }}
run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: >
Expand Down