-
Notifications
You must be signed in to change notification settings - Fork 59
80 lines (78 loc) · 3.48 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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.25", "pythonVersion": "3.10" }
- { "djangoVersion": "4.2.11", "pythonVersion": "3.10" }
- { "djangoVersion": "4.2.11", "pythonVersion": "3.11" }
- { "djangoVersion": "4.2.11", "pythonVersion": "3.12" }
- { "djangoVersion": "5.0.4", "pythonVersion": "3.10" }
- { "djangoVersion": "5.0.4", "pythonVersion": "3.11" }
- { "djangoVersion": "5.0.4", "pythonVersion": "3.12" }
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Set up Python 🐍
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.versions.pythonVersion }}
- name: Install xmlsec1 📦
run: sudo apt-get install xmlsec1
- name: Install dependencies 📦
run: |
python -m pip install poetry
poetry install --with dev
- name: Install Django ${{ matrix.versions.djangoVersion }} 📦
run: pip install Django==${{ matrix.versions.djangoVersion }}
- name: Check types, syntax and duckstrings 🦆
run: |
poetry run mypy --explicit-package-bases .
poetry run ruff check .
poetry run interrogate --ignore-init-module --quiet --fail-under=95 .
- name: Test Django ${{ matrix.versions.djangoVersion }} with coverage 🧪
run: poetry run coverage run --source=django_saml2_auth -m pytest . && poetry run coverage lcov -o coverage.lcov
- name: Submit coverage report to Coveralls 📈
if: ${{ success() }}
uses: coverallsapp/github-action@v2
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: |
poetry run cyclonedx-bom -r --format json -i requirements.txt -o cyclonedx-django-saml2-auth-${{ github.ref_name }}.json
poetry run 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@v4
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@v4
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