Skip to content

Fixes accessibility errors #38

Fixes accessibility errors

Fixes accessibility errors #38

Workflow file for this run

name: Trackdechets Website CI
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: admin
POSTGRES_DB: td_website_test
ports: [ '5432:5432' ]
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Set locales
run: sudo apt-get install -y tzdata locales && sudo locale-gen fr_FR && sudo dpkg-reconfigure --frontend=noninteractive locales
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
- name: Install pipenv
run: |
python -m pip install --upgrade pipenv wheel
- id: cache-pipenv
uses: actions/cache@v2
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- name: Install python dependencies
if: steps.cache-pipenv.outputs.cache-hit != 'true'
run: |
pipenv install --deploy --dev
- name: Ruff lint
run: pipenv run ruff check .
- name: Ruff format
run: pipenv run ruff format --check .
- name: Bandit security checks
run: pipenv run bandit --exit-zero -c pyproject.toml -r src
- name: Bandit security checks
run: pipenv run bandit --exit-zero -c pyproject.toml -r src
- name: Run Tests
working-directory: src
run: |
pipenv run pytest
env:
DJANGO_SETTINGS_MODULE: core.settings.test
DATABASE_URL: postgresql://admin:postgres@localhost/td_website_test
ADMIN_SLUG: admin
WEBINARS_DOMAIN: formations
BREVO_GENERAL_NEWSLETTER_ID: 1
BREVO_TECH_NEWSLETTER_ID: 2
BREVO_API_KEY: x