Skip to content

Commit

Permalink
#112 Add windows to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
vernans committed Sep 22, 2023
1 parent 77efeb4 commit bf1db7a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
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: 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
- 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 @@ -13,7 +13,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

0 comments on commit bf1db7a

Please sign in to comment.