Add support for direct serving #480
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: Continuous Integration | |
on: push | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.12"] | |
django-version: ["3.2.25", "4.2.11"] | |
database-engine: ["postgres", "mysql"] | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
mysql: | |
image: mysql | |
env: | |
MYSQL_ROOT_PASSWORD: rootpassword | |
options: >- | |
--health-cmd "mysqladmin ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 3306:3306 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install requirements | |
run: | | |
python -m venv .venv | |
.venv/bin/pip install django==${{ matrix.django-version }} -r ci-requirements.txt | |
- name: Run linting | |
run: .venv/bin/flake8 binder | |
- name: Prepare postgres database | |
run: | | |
psql -c 'CREATE DATABASE "binder-test";' -h localhost -U postgres | |
if: matrix.database-engine == 'postgres' | |
- name: Prepare mysql database | |
run: | | |
mysql --protocol=TCP -h localhost -u root -prootpassword -e 'CREATE DATABASE `binder-test`;' | |
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql --protocol=TCP -h localhost -u root -prootpassword mysql | |
if: matrix.database-engine == 'mysql' | |
- name: Run tests | |
run: | | |
.venv/bin/coverage run --include="binder/*" -m unittest discover -vt . -s tests | |
env: | |
BINDER_TEST_MYSQL: ${{ matrix.database-engine == 'mysql' && 1 || 0 }} | |
CY_RUNNING_INSIDE_CI: 1 | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v1 |