Merge pull request #193 from grafana/dependabot/pip/pyjwt-2.8.0 #400
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
name: deploy | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
test: | |
name: Test and build django-saml2-auth | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
versions: | |
- { "djangoVersion": "3.2.20", "pythonVersion": "3.7" } | |
- { "djangoVersion": "3.2.20", "pythonVersion": "3.8" } | |
- { "djangoVersion": "3.2.20", "pythonVersion": "3.9" } | |
- { "djangoVersion": "3.2.20", "pythonVersion": "3.10" } | |
- { "djangoVersion": "4.1.10", "pythonVersion": "3.8" } | |
- { "djangoVersion": "4.1.10", "pythonVersion": "3.9" } | |
- { "djangoVersion": "4.1.10", "pythonVersion": "3.10" } | |
- { "djangoVersion": "4.2.3", "pythonVersion": "3.8" } | |
- { "djangoVersion": "4.2.3", "pythonVersion": "3.9" } | |
- { "djangoVersion": "4.2.3", "pythonVersion": "3.10" } | |
- { "djangoVersion": "4.2.3", "pythonVersion": "3.11" } | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Set up Python 🐍 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.versions.pythonVersion }} | |
- name: Install xmlsec1 📦 | |
run: sudo apt-get install xmlsec1 | |
- name: Install dependencies 📦 | |
run: python -m pip install -r requirements_test.txt && python -m pip install -e . | |
- name: Install Django ${{ matrix.versions.djangoVersion }} 📦 | |
run: python -m pip install Django==${{ matrix.versions.djangoVersion }} | |
- name: Check types, syntax and duckstrings 🦆 | |
run: | | |
mypy . | |
flake8 . | |
interrogate --quiet --fail-under=95 . | |
- name: Test Django ${{ matrix.versions.djangoVersion }} with coverage 🧪 | |
run: coverage run --source=django_saml2_auth -m pytest . && coverage lcov -o coverage.lcov | |
- name: Submit coverage report to Coveralls 📈 | |
if: ${{ success() }} | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: ./coverage.lcov | |
- name: Install build dependencies 📦 | |
run: python -m pip install build --user | |
- name: Build a binary wheel and a source tarball 🏗️ | |
run: python -m build --sdist --wheel . | |
- name: Generate CycloneDX SBOM artifacts 📃 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
cyclonedx-bom -r --format json -i requirements.txt -o cyclonedx-django-saml2-auth-${{ github.ref_name }}.json | |
cyclonedx-bom -r --format json -i requirements_test.txt -o cyclonedx-django-saml2-auth-test-${{ github.ref_name }}.json | |
- name: Upload CycloneDX SBOM artifact for requirements.txt 💾 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cyclonedx-django-saml2-auth-${{ github.ref_name }}.json | |
path: cyclonedx-django-saml2-auth-${{ github.ref_name }}.json | |
- name: Upload CycloneDX SBOM artifact for requirements_test.txt 💾 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cyclonedx-django-saml2-auth-test-${{ github.ref_name }}.json | |
path: cyclonedx-django-saml2-auth-test-${{ github.ref_name }}.json | |
- name: Publish package to PyPI 🎉 | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_API_TOKEN }} | |
skip_existing: true |