Skip to content

Commit

Permalink
feat: Official Nox GitHub Action (#594)
Browse files Browse the repository at this point in the history
* feat: adding native composite github action

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* docs: mention action

* fix: use current version of Nox

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>

* fix: minor style fixes from lint

Co-authored-by: Tom Fleet <tomfleet2018@gmail.com>
  • Loading branch information
henryiii and FollowTheProcess committed Apr 28, 2022
1 parent ad773c8 commit ca5f6e7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
35 changes: 35 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Setup Nox
description: 'Prepares all python versions for nox'
branding:
icon: package
color: blue

runs:
using: composite
steps:
- uses: actions/setup-python@v3
with:
python-version: "pypy-3.7"
- uses: actions/setup-python@v3
with:
python-version: "pypy-3.8"
- uses: actions/setup-python@v3
with:
python-version: "pypy-3.9"

- uses: actions/setup-python@v3
with:
python-version: "3.7"
- uses: actions/setup-python@v3
with:
python-version: "3.8"
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: "Install nox"
run: pipx install '${{ github.action_path }}'
shell: bash
7 changes: 4 additions & 3 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ Or you can be extra fancy and use `pipx`_:
Either way, Nox is usually installed *globally*, similar to ``tox``, ``pip``, and other similar tools.

If you're interested in running ``nox`` within `docker`_, you can use the `thekevjames/nox images`_ on DockerHub which contain builds for all ``nox`` versions and all supported ``python`` versions.
If you're interested in running ``nox`` within `docker`_, you can use the `thekevjames/nox images`_ on DockerHub which contain builds for all ``nox`` versions and all supported ``python`` versions. Nox is also supported via ``pipx run nox`` in the `manylinux images`_.

If you want to run ``nox`` within `GitHub Actions`_, you can use the `excitedleigh/setup-nox action`_, which installs the latest ``nox`` and makes available all Python versions provided by the GitHub Actions environment.
If you want to run ``nox`` within `GitHub Actions`_, you can use the `wntrblm/nox action`_, which installs the latest ``nox`` and makes available all active CPython and PyPY versions provided by the GitHub Actions environment. You can safely combine this with with ``setup-python`` for past end-of-life or development versions of Python, as well.

.. _pip: https://pip.readthedocs.org
.. _user site: https://packaging.python.org/tutorials/installing-packages/#installing-to-the-user-site
.. _pipx: https://packaging.python.org/guides/installing-stand-alone-command-line-tools/
.. _docker: https://www.docker.com/
.. _thekevjames/nox images: https://hub.docker.com/r/thekevjames/nox
.. _GitHub Actions: https://github.com/features/actions
.. _excitedleigh/setup-nox action: https://github.com/marketplace/actions/setup-nox
.. _wntrblm/nox action: https://github.com/marketplace/actions/nox
.. _manylinux images: https://github.com/pypa/manylinux

Writing the configuration file
------------------------------
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ignore_missing_imports = true

[tool.check-manifest]
ignore = [
"action.yml",
"docs/**",
"noxfile.py",
"requirements-conda-test.txt",
Expand Down

0 comments on commit ca5f6e7

Please sign in to comment.