Skip to content

Merge pull request #78 from maykinmedia/chore/encrypted-private-key-s… #331

Merge pull request #78 from maykinmedia/chore/encrypted-private-key-s…

Merge pull request #78 from maykinmedia/chore/encrypted-private-key-s… #331

Workflow file for this run

name: Run CI
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
tests:
name: "Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }}, OIDC: ${{ matrix.oidc_enabled }})"
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.10', '3.11', '3.12']
django: ['4.2']
oidc_enabled: ['no', 'yes']
services:
postgres:
image: postgres:15
env:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install OS dependencies
run: |
sudo apt-get update
sudo apt-get install --yes libxml2-dev libxmlsec1-dev libxmlsec1-openssl gettext
- name: Install dependencies
run: pip install tox tox-gh-actions
- name: Run tests
run: |
tox -- ${{ matrix.oidc_enabled != 'yes' && '--ignore tests/oidc' || '' }}
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO: ${{ matrix.django }}
OIDC_ENABLED: ${{ matrix.oidc_enabled }}
PGUSER: postgres
PGHOST: localhost
- name: Publish coverage report
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.oidc_enabled == 'yes' && 'oidc' || 'base' }}
publish:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build sdist and wheel
run: |
pip install build --upgrade
python -m build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}