Merge branch 'refs/heads/main' into performances-seen-unseen #906
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: Django tests + Mypy | |
on: | |
push: | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
services: | |
postgres: | |
image: postgis/postgis:13-3.1 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: github_actions | |
ports: | |
- 5432:5432 | |
# needed because the postgres container does not provide a health check | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
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 additional libraries | |
run: | | |
sudo apt-get update | |
sudo apt-get install binutils libproj-dev gdal-bin gettext | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}-v9 | |
- name: Install dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install Django settings | |
run: cp djangoproject/local_settings_ci.py djangoproject/local_settings.py | |
- name: Show chrome version (for debugging purposes) | |
run: google-chrome --version | |
- name: Install frontend dependencies | |
run: npm install | |
- name: Run webpack | |
run: npm run webpack-prod | |
- name: Run Django tests | |
env: | |
DJANGO_SETTINGS_MODULE: djangoproject.local_settings | |
run: | | |
source .venv/bin/activate | |
python manage.py test | |
- name: Run mypy | |
run: poetry run mypy --install-types --non-interactive . |