chore(deps): bump actions/cache from 3.2.6 to 4.1.2 #6351
Workflow file for this run
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: Test & Lint tasks | |
on: [push] | |
jobs: | |
linting_check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.11.9] | |
env: | |
DJANGO_SETTINGS_MODULE: config.settings.test | |
DJANGO_SECRET_KEY: ministryofsillywalks | |
PYTHONPATH: . | |
POSTGRESQL_ADDON_HOST: localhost | |
POSTGRESQL_ADDON_DB: postgres | |
POSTGRESQL_ADDON_USER: postgres | |
POSTGRESQL_ADDON_PASSWORD: postgres | |
CELLAR_ADDON_KEY_ID: TheMeaningOfLife | |
CELLAR_ADDON_KEY_SECRET: "42" | |
CELLAR_ADDON_HOST: example.com | |
services: | |
postgres: | |
# Docker Hub image | |
image: postgis/postgis:14-3.1 | |
env: | |
POSTGRES_PASSWORD: postgres | |
ports: | |
- 5432:5432 | |
# Set health checks to wait until postgres has started | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11.9 | |
#---------------------------------------------- | |
# install & configure poetry | |
#---------------------------------------------- | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: true | |
#---------------------------------------------- | |
# load cached venv if cache exists | |
#---------------------------------------------- | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/[email protected] | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Install Python dependencies | |
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | |
run: poetry install --no-interaction --no-root | |
- name: Install System dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install gdal-bin | |
#---------------------------------------------- | |
# install your root project | |
#---------------------------------------------- | |
- name: 📥 Install dependencies | |
run: poetry install --no-interaction | |
#---------------------------------------------- | |
# migration checks | |
#---------------------------------------------- | |
# - name: 💾 Create a database to check migrations | |
# run: | | |
# psql <<SQL | |
# CREATE DATABASE marche; | |
# SQL | |
- name: 🚧 Check pending migrations | |
run: | | |
source .venv/bin/activate | |
python manage.py makemigrations --check --dry-run --noinput | |
#---------------------------------------------- | |
# run lint suite | |
# Why not install default flake8 or pylint ? | |
# Because we use pyproject.toml config file, and | |
# prefer locally reproducible tests. | |
#---------------------------------------------- | |
- name: ✨ Run Linters | |
run: | | |
source .venv/bin/activate | |
echo "flake8" | |
pflake8 "./lemarche" | |
echo "black" | |
black . --check | |
echo "isort" | |
isort ./lemarche/*.py --check-only | |
#---------------------------------------------- | |
# run tests | |
# collectstatic needed for selenium tests | |
#---------------------------------------------- | |
- name: 🤹 Run Tests | |
run: | | |
source .venv/bin/activate | |
python manage.py collectstatic | |
coverage run --source='./lemarche' ./manage.py test --parallel auto lemarche | |
coverage report |