Skip to content

Mod/subtypes columns #2

Mod/subtypes columns

Mod/subtypes columns #2

Workflow file for this run

name: TD Validator CI
on: pull_request
jobs:
test:
runs-on: ubuntu-latest
services:
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--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 Linting
run: pipenv run ruff check .
- name: Ruff Formatting
run: pipenv run ruff format --check .
- 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
ADMIN_SLUG: admin
USER_NAME: joe
PASSWORD: pass
TD_COMPANY_ELASTICSEARCH_INDEX: index
TD_COMPANY_ELASTICSEARCH_CACERTS_CONTENT: -----BEGIN CERTIFICATE-----\xyz\n-----END CERTIFICATE-----
TD_COMPANY_ELASTICSEARCH_URL: http://trackdechets-search