Skip to content

Update from keycloak-support (#52) #170

Update from keycloak-support (#52)

Update from keycloak-support (#52) #170

Workflow file for this run

name: Test python package
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
pydantic-version: ['1.*', '2.*']
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flit
flit install --deps develop
pip install -U "pydantic==${{ matrix.pydantic-version }}"
pip install pydantic_settings || true
- name: Lint
run: |
black . --check
ruff .
- name: MyPy
run: |
mypy -p oauth2_lib
- name: License headers
run: |
apache-license-check --copyright "2019-`date +%Y` SURF" oauth2_lib
- name: Test with pytest
run: |
pytest -vvv --cov-branch --cov-fail-under=80 --cov=oauth2_lib --cov-config=.coveragerc --junitxml=report-pytest-${{ matrix.python-version }}.xml
- name: Upload pytest test results
uses: actions/upload-artifact@v2
with:
name: pytest-results-${{ matrix.python-version }}
path: report-pytest-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ matrix.pydantic-version == '2.*' }} && ${{ always() }}