Skip to content

Commit

Permalink
Convert CI to use GHA (#331)
Browse files Browse the repository at this point in the history
Adds initial Github Actions based test and release tooling.
  • Loading branch information
corydolphin committed Jun 26, 2023
1 parent 637595d commit 0b74401
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 54 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,29 @@
name: Release to PyPi

on:
release:
types: [published]

jobs:
deploy:
name: upload release to PyPI
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
28 changes: 28 additions & 0 deletions .github/workflows/unittests.yaml
@@ -0,0 +1,28 @@
name: Python package

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11"]
dependencies:
- "flask==1.1 Jinja2==3.0.3 itsdangerous==2.0.1 werkzeug==2.0.3"
- "flask==2.3.2"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# You can test your matrix by printing the current Python version
- name: Install deps
run: pip install -U setuptools pep8 coverage docutils pygments packaging pytest pytest-cov ${{ matrix.dependencies }}
- name: Run tests
run: |
coverage erase
python setup.py clean build install
pytest --cov=flask_cors
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion flask_cors/extension.py
Expand Up @@ -160,7 +160,7 @@ def init_app(self, app, **kwargs):
for (pattern, opts) in resources
]

# Create a human readable form of these resources by converting the compiled
# Create a human-readable form of these resources by converting the compiled
# regular expressions into strings.
resources_human = {get_regexp_pattern(pattern): opts for (pattern,opts) in resources}
LOG.debug("Configuring CORS with resources: %s", resources_human)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -33,10 +33,10 @@
platforms='any',
install_requires=install_requires,
tests_require=[
'nose',
'pytest',
'packaging'
],
test_suite='nose.collector',
test_suite='tests',
classifiers=[
'Environment :: Web Environment',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 0b74401

Please sign in to comment.