Skip to content

Commit

Permalink
chore: clean up tox environments & CI gates (#2353)
Browse files Browse the repository at this point in the history
* docs(README): the more badges the merrier

* chore: simlify some gate names

* chore: clean up some tox envs

* chore: more tox/CI cleanup

* chore: remove Hug integration tests, Hug seems to be dead :((

* chore(CI): clean up test definitions in `tests.yaml`

* chore(CI): only run legacy tests on branches

* chore(CI): update README badges, add cp38 to wheels as we still support 3.8

* chore(CI): restore test-wheels not to run on PR
  • Loading branch information
vytas7 authored Oct 4, 2024
1 parent 46b7fdd commit 67c4501
Show file tree
Hide file tree
Showing 8 changed files with 175 additions and 228 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/test-other.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Other tests, primarily those requiring obsolete dependencies.
name: test-other

on:
push:
branches:
- "*"

jobs:
run-tox:
name: tox -e ${{ matrix.toxenv }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
toxenv:
- "py38_smoke"
- "py38_smoke_cython"
- "wsgi_meinheld"

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install smoke test dependencies
run: |
sudo apt-get update
sudo apt-get install -y libunwind-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools tox wheel
python --version
pip --version
tox --version
- name: Run tox
run: tox -e ${{ matrix.toxenv }}
2 changes: 2 additions & 0 deletions .github/workflows/test-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- build: "cp313-manylinux_s390x"
os: ubuntu-latest
emulation: true
- build: "cp38-manylinux_x86_64"
os: ubuntu-latest
- build: "cp313-musllinux_x86_64"
os: ubuntu-latest
- build: "cp313-macosx_arm64"
Expand Down
179 changes: 68 additions & 111 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Run tests
# Run tests in various tox environments.
name: tests

on:
# NOTE(vytas): Trigger the tests workflow on push or pull request
Expand All @@ -11,104 +12,73 @@ on:
- master

jobs:
run_tox:
name: tox -e ${{ matrix.toxenv }} (${{matrix.python-version}} on ${{ matrix.os }})
runs-on: ${{ matrix.os }}
run-tox:
name: tox -e ${{ matrix.tox.env }}${{ matrix.tox.platform-label || '' }}
runs-on: ${{ matrix.tox.os || matrix.default-os }}
strategy:
fail-fast: false
matrix:
default-os:
- "ubuntu-latest"
python-version:
- "3.12"
python-dev-version:
- ""
os:
- "ubuntu-latest"
toxenv:
- "pep8"
- "pep8-docstrings"
- "pep8-examples"
- "ruff"
- "mypy"
- "mypy_tests"
- "py312"
- "py312_sans_msgpack"
- "py312_cython"
- "docs"
- "towncrier"
- "look"
- "asgilook"
- "ws_tutorial"
# NOTE(vytas): Temporarily disabled while we are releasing a
# new version of python-mimeparse, and haven't decided yet whether
# to keep vendoring or reimplement.
# - "check_vendored"
- "twine_check"
- "daphne"
- "hypercorn"
- "e2e_chrome"
- "e2e_firefox"
- "no_optional_packages"
# TODO(kgriffs): Re-enable once hug has a chance to address
# breaking changes in Falcon 3.0
# - "hug"
include:
- python-version: pypy3.9
os: ubuntu-latest
toxenv: pypy3
- python-version: "3.8"
os: ubuntu-latest
toxenv: py38
- python-version: "3.9"
os: ubuntu-latest
toxenv: py39
- python-version: "3.9"
os: ubuntu-latest
toxenv: py39_cython
- python-version: "3.10"
os: ubuntu-latest
toxenv: py310
- python-version: "3.10"
os: ubuntu-latest
toxenv: py310_cython
- python-version: "3.11"
os: ubuntu-latest
toxenv: py311
- python-version: "3.11"
os: ubuntu-latest
toxenv: py311_cython
- python-version: "3.12"
os: ubuntu-latest
toxenv: py312
- python-version: "3.12"
os: ubuntu-latest
toxenv: py312_cython
- python-version: "3.12"
tox:
# Lint
- env: pep8
- env: pep8-docstrings
- env: ruff
# Documentation
- env: docs
- env: towncrier
# Typing
- env: mypy
- env: mypy_tests
# Python tests
- env: mintest
coverage: true
- env: pypy3
python-version: "pypy3.10"
- env: py38
python-version: "3.8"
- env: py39
python-version: "3.9"
- env: py310
python-version: "3.10"
- env: py310_cython
python-version: "3.10"
- env: py311
python-version: "3.11"
- env: py311_cython
python-version: "3.11"
- env: py312
coverage: true
python-version: "3.12"
- env: py312_cython
python-version: "3.12"
- env: py313
python-version: "3.13.0-rc.3 - 3.13"
- env: py313_cython
python-version: "3.13.0-rc.3 - 3.13"
- env: py312_nocover
os: macos-latest
toxenv: py312_nocover
- python-version: "3.12"
platform-label: ' (macos)'
- env: py312_nocover
os: windows-latest
toxenv: py312_nocover
- python-version: "3.13"
python-dev-version: "3.13.0-rc.1 - 3.13"
os: ubuntu-latest
toxenv: py313
- python-version: "3.13"
python-dev-version: "3.13.0-rc.1 - 3.13"
os: ubuntu-latest
toxenv: py313_cython
# These env require 3.8 and 20.04, see tox.ini
- python-version: "3.8"
os: ubuntu-20.04
toxenv: py38_smoke
- python-version: "3.8"
os: ubuntu-20.04
toxenv: py38_smoke_cython
- python-version: "3.8"
os: ubuntu-latest
toxenv: "wsgi_servers"
platform-label: ' (windows)'
# Tutorials
- env: "look"
- env: "asgilook"
- env: "ws_tutorial"
# Tooling
- env: "twine_check"
# ASGI & WSGI servers
- env: "daphne"
- env: "hypercorn"
- env: "wsgi_servers"
# E2E tests
- env: "e2e_chrome"
- env: "e2e_firefox"

# Steps to run in each job.
# Some are GitHub actions, others run shell commands.
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -119,43 +89,30 @@ jobs:

- name: Set up Python
uses: actions/setup-python@v5
if: ${{ !matrix.python-dev-version }}
with:
python-version: ${{ matrix.python-version }}

- name: Set up Python (pre-release)
uses: actions/setup-python@v5
if: ${{ matrix.python-dev-version }}
with:
python-version: ${{ matrix.python-dev-version }}

- name: Install smoke test dependencies
if: ${{ matrix.toxenv == 'py38_smoke' || matrix.toxenv == 'py38_smoke_cython' }}
run: |
sudo apt-get update
sudo apt-get install -y libunwind-dev
python-version: ${{ matrix.tox.python-version || matrix.python-version }}

- name: Install dependencies
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -U coverage fixtures setuptools tox wheel
pip install --upgrade coverage setuptools tox wheel
python --version
pip --version
tox --version
coverage --version
- name: Run tests
run: tox -e ${{ matrix.toxenv }}
- name: Run tox
run: tox -e ${{ matrix.tox.env }}

- name: Combine coverage
if: ${{ matrix.toxenv == 'py312' || matrix.toxenv == 'py312_sans_msgpack' }}
if: ${{ matrix.tox.coverage }}
run: |
coverage --version
coverage combine
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: ${{ matrix.toxenv == 'py312' || matrix.toxenv == 'py312_sans_msgpack' }}
if: ${{ matrix.tox.coverage }}
with:
env_vars: PYTHON
fail_ci_if_error: true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run tests (contributor's checklist)
name: test-tox-sdist

on:
# Trigger the workflow on master but also allow it to run manually.
Expand Down
12 changes: 8 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
:target: https://falconframework.org/
:width: 100 %

|Build Status| |Docs| |codecov.io|
|Build status| |Docs| |codecov.io| |PyPI package| |Python versions|

The Falcon Web Framework
========================
Expand Down Expand Up @@ -978,13 +978,17 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

.. |Build status| image:: https://github.com/falconry/falcon/actions/workflows/tests.yaml/badge.svg
:target: https://github.com/falconry/falcon/actions/workflows/tests.yaml
.. |Docs| image:: https://readthedocs.org/projects/falcon/badge/?version=stable
:alt: Falcon web framework docs
:target: https://falcon.readthedocs.io/en/stable/?badge=stable
.. |Build Status| image:: https://github.com/falconry/falcon/workflows/Run%20tests/badge.svg
:target: https://github.com/falconry/falcon/actions?query=workflow%3A%22Run+tests%22
.. |codecov.io| image:: https://codecov.io/gh/falconry/falcon/branch/master/graphs/badge.svg
:target: http://codecov.io/gh/falconry/falcon
:target: https://codecov.io/gh/falconry/falcon
.. |PyPI package| image:: https://badge.fury.io/py/falcon.svg
:target: https://pypi.org/project/falcon/
.. |Python versions| image:: https://img.shields.io/pypi/pyversions/falcon.svg
:target: https://pypi.org/project/falcon/
.. |Backer:GovCert| image:: https://falconframework.org/assets/govcert.png
:alt: CERT Gouvernemental Luxembourg
:height: 60px
Expand Down
23 changes: 0 additions & 23 deletions tools/testing/install_hug.sh

This file was deleted.

8 changes: 0 additions & 8 deletions tools/testing/test_hug.sh

This file was deleted.

Loading

0 comments on commit 67c4501

Please sign in to comment.