-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swap CircleCI for GH Actions for CI: test and relase publishing
- Loading branch information
1 parent
b72f712
commit 6c6ab4d
Showing
4 changed files
with
92 additions
and
94 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: "CI" # Note that this name appears in the README's badge | ||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
pull_request: | ||
release: | ||
types: [published] | ||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- '3.8' | ||
- '3.9' | ||
- '3.10' | ||
- '3.11' | ||
- '3.12' | ||
- 'pypy-3.8' | ||
- 'pypy-3.9' | ||
- 'pypy-3.10' | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
- name: Test with tox | ||
run: tox | ||
|
||
release: | ||
name: Release django-csp | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
needs: | ||
- run-tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
- name: Install dependencies for package building only | ||
run: pip install build | ||
- name: Build package for upload to PyPI | ||
run: python -m build . | ||
- name: Upload the distribution to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,56 @@ | ||
[tox] | ||
envlist = | ||
{3.10,3.11,3.12,pypy3}-main | ||
{3.10,3.11,3.12pypy3}-5.0.x | ||
{3.8,3.9,3.10,3.11,3.12,pypy3}-4.2.x | ||
{3.8,3.9,3.10,pypy3}-3.2.x | ||
{3.10,3.11,3.12,pypy310}-main | ||
{3.10,3.11,3.12,pypy310}-5.0.x | ||
{3.8,3.9,3.10,3.11,3.12,pypy38,pypy39,pypy310}-4.2.x | ||
{3.8,3.9,3.10,pypy38,pypy39,pypy310}-3.2.x | ||
|
||
|
||
# Don't run coverage when testing with pypy: | ||
# see https://github.com/nedbat/coveragepy/issues/1382 | ||
[testenv:pypy310-main,pypy310-5.0.x,{pypy38,pypy39,pypy310}-4.2.x,{pypy38,pypy39,pypy310}-3.2.x] | ||
commands = | ||
pip install --upgrade pip | ||
pip install -e .[tests] | ||
pytest {toxinidir}/csp | ||
|
||
|
||
[testenv] | ||
setenv = | ||
PYTHONPATH={toxinidir} | ||
PYTHONDONTWRITEBYTECODE=1 | ||
|
||
commands = | ||
pip install --upgrade pip | ||
pip install -e .[tests] | ||
pytest --cov={toxinidir}/csp {toxinidir}/csp | ||
|
||
basepython = | ||
3.8: python3.8 | ||
3.9: python3.9 | ||
3.10: python3.10 | ||
3.11: python3.11 | ||
3.12: python3.12 | ||
pypy3: pypy3 | ||
deps= | ||
|
||
deps = | ||
pytest | ||
3.2.x: Django>=3.2,<3.3 | ||
4.2.x: Django>=4.2,<4.3 | ||
5.0.x: Django>=5.0.1,<5.1 | ||
main: https://github.com/django/django/archive/main.tar.gz | ||
|
||
|
||
[gh-actions] | ||
# Running tox in GHA without redefining it all in a GHA matrix: | ||
# https://github.com/ymyzk/tox-gh-actions | ||
python = | ||
3.7: py37 | ||
3.8: py38 | ||
3.9: py39 | ||
3.10: py310 | ||
3.11: py311 | ||
3.12: py312 | ||
pypy-3.8: pypy38 | ||
pypy-3.9: pypy39 | ||
pypy-3.10: pypy310 |