v1.0.2 #20
Workflow file for this run
This file contains hidden or 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
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - '*.*.*' | |
| pull_request: | |
| branches: | |
| - main | |
| - '*.*.*' | |
| release: | |
| types: [ published ] | |
| jobs: | |
| black: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: '3.13' | |
| - name: Install packages | |
| run: pip install -r requirements_dev.txt | |
| - name: Black | |
| run: | | |
| black --check -l 120 simple_oauth2/ tests/ | |
| isort: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: '3.13' | |
| - name: Install packages | |
| run: pip install -r requirements_dev.txt | |
| - name: Isort | |
| run: | | |
| isort --check simple_oauth2/ tests/ | |
| pycodestyle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: '3.13' | |
| - name: Install packages | |
| run: pip install -r requirements_dev.txt | |
| - name: Pycodestyle | |
| run: | | |
| pycodestyle simple_oauth2/ tests/ | |
| pydocstyle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: '3.13' | |
| - name: Install packages | |
| run: pip install -r requirements_dev.txt | |
| - name: Pydocstyle | |
| run: | | |
| pydocstyle --count simple_oauth2/ | |
| mypy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: '3.13' | |
| - name: Install packages | |
| run: pip install -r requirements_dev.txt | |
| - name: Mypy | |
| run: | | |
| mypy simple_oauth2 --disallow-untyped-def | |
| bandit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: '3.13' | |
| - name: Install packages | |
| run: pip install -r requirements_dev.txt | |
| - name: Bandit | |
| run: | | |
| bandit --ini=setup.cfg -ll 2> /dev/null | |
| test: | |
| needs: [black, isort, pycodestyle, pydocstyle, bandit] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ '3.10', '3.11', '3.12', '3.13'] | |
| django-version: [ 42, 51, 52 ] | |
| exclude: | |
| - python-version: 3.13 | |
| django-version: 42 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@master | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Tox and any other packages | |
| run: | | |
| pip install tox | |
| - name: Python ${{ matrix.python-version }}, Django ${{ matrix.django-version }}, | |
| run: tox -e py-django${{ matrix.django-version }} | |
| - name: Upload coverage to Codecov | |
| if: matrix.python-version == 3.13 && matrix.django-version == 52 | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| file: ./coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| publish: | |
| needs: test | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/drf-simple-oauth2 | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@master | |
| - name: Set up Python 3.13 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.13' | |
| - name: Build the package | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| python -m build | |
| - name: Verify metadata | |
| run: | | |
| python -m pip install twine | |
| python -m twine check dist/* | |
| - name: Publish distribution to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |