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

Replace template CI from AppVeyor -> GitHub Actions #62

Merged
merged 2 commits into from
Jan 20, 2024
Merged

Conversation

bluetech
Copy link
Member

This is the more common/easier choice these days, and also doesn't run only on windows(?).

@nicoddemus
Copy link
Member

and also doesn't run only on windows(?).

AFAIK it supports all platforms, in fact GH Actions runs on Azure. But definitely using GA is the way to go here. 👍

Copy link
Member

@nicoddemus nicoddemus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Comment on lines 11 to 40
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: '3.8'
tox-env: 'py38'
- python-version: '3.9'
tox-env: 'py39'
- python-version: '3.10'
tox-env: 'py310'
- python-version: '3.11'
tox-env: 'py311'
- python-version: '3.12'
tox-env: 'py312'
- python-version: 'pypy-3.8'
tox-env: 'pypy3'
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: {% raw -%}${{ matrix.python-version }}{% endraw %}

- name: Install tox
run: pip install tox

- name: Test
run: tox -e {% raw -%}${{ matrix.tox-env }}{% endraw -%}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tox -e py runs using the current interpreter, so this can be simplified:

Suggested change
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python-version: '3.8'
tox-env: 'py38'
- python-version: '3.9'
tox-env: 'py39'
- python-version: '3.10'
tox-env: 'py310'
- python-version: '3.11'
tox-env: 'py311'
- python-version: '3.12'
tox-env: 'py312'
- python-version: 'pypy-3.8'
tox-env: 'pypy3'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: {% raw -%}${{ matrix.python-version }}{% endraw %}
- name: Install tox
run: pip install tox
- name: Test
run: tox -e {% raw -%}${{ matrix.tox-env }}{% endraw -%}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.8']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: {% raw -%}${{ matrix.python-version }}{% endraw %}
- name: Install tox
run: pip install tox
- name: Test
run: tox -e py

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I never seen that raw directive in python-version, what is that for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

The raw is escaping for the Jinja template language which cookiecutter uses, otherwise the ${{ .. }} is interpreted by Jinja.

@bluetech bluetech merged commit c906239 into main Jan 20, 2024
5 checks passed
@bluetech bluetech deleted the github-actions branch January 20, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants