ldap authentication + docker compose example + sqlite option #299
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: build | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Start PostgreSQL on Ubuntu | |
run: | | |
sudo systemctl start postgresql.service | |
pg_isready | |
- name: Create client user | |
run: | | |
sudo -u postgres psql --command="CREATE USER client PASSWORD 'not-so-secret django db password'" --command="\du" | |
sudo -u postgres psql --command="ALTER USER client CREATEDB;" --command="\du" | |
- name: Edit git settings | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Github Actions" | |
- name: Checkout repository and submodules | |
uses: actions/checkout@v1 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libldap2-dev libsasl2-dev | |
python -m pip install --upgrade pip wheel | |
python -m pip install flake8 pytest pytest-django | |
python -m pip install -r requirements/requirements.txt | |
python -m pip install -r requirements/dev.txt | |
- name: List installed dependency versions | |
run: | | |
python -m pip list | |
- name: Lint with flake8 | |
run: | | |
python -m flake8 client | |
- name: Test sorting with isort | |
run: | | |
python -m isort --verbose --check-only client | |
- name: Test with pytest | |
run: | | |
python -m pytest --cov=client --cov-config=client/.coveragerc --cov-report term-missing client | |
env: | |
DJANGO_SUPERUSER_EMAIL: [email protected] | |
PGDATABASE: django | |
PGUSER: client | |
PGPASSWORD: not-so-secret django db password | |
PGHOST: localhost | |
PGPORT: 5432 | |
DJANGO_SECRET_KEY: 'django very secret key, honest' | |
- uses: codecov/codecov-action@v1 | |
with: | |
token: 8bb2c432-b415-4a43-adab-ff5a9016de64 # not required for public repos |