<commit_before>name: Python application

on:
  push:
    branches: [ main ]
  pull_request:

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Apt update
      run: sudo apt update
    - name: Install apt packages
      run: sudo apt install -y graphicsmagick mupdf-tools ghostscript unoconv python3-dev
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: "3.10"

    - name: Install pre-commit
      run: pip install pre-commit

    - name: Check pre-commit
      run: pre-commit run --all-files

    - name: Install python packages
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Django checks
      run: ./manage.py check

    - name: Check migrations
      run: ./manage.py makemigrations --dry-run --check

    - name: mypy
      run: mypy

    - name: Statics checks
      run: ./manage.py collectstatic --noinput -v 0

    - name: pytest
      run: pytest -k "not unoconv"

    - name: database checks
      run: make database<commit_msg>Use the pre-commit/action github action instead of doing it by hand (#266)<commit_after>name: Python application

on:
  push:
    branches: [ main ]
  pull_request:

jobs:
  pre-commit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v3
      - uses: pre-commit/action@v3.0.0

  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Apt update
      run: sudo apt update
    - name: Install apt packages
      run: sudo apt install -y graphicsmagick mupdf-tools ghostscript unoconv python3-dev
    - name: Set up Python
      uses: actions/setup-python@v4
      with:
        python-version: "3.10"

    - name: Install python packages
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt

    - name: Django checks
      run: ./manage.py check

    - name: Check migrations
      run: ./manage.py makemigrations --dry-run --check

    - name: mypy
      run: mypy

    - name: Statics checks
      run: ./manage.py collectstatic --noinput -v 0

    - name: pytest
      run: pytest -k "not unoconv"

    - name: database checks
      run: make database
{'fraction_non_alphanumeric': 0.09415867480383609, 'fraction_numerical': 0.00959023539668701, 'mean_word_length': 2.0397350993377485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1060176', 'n_tokens_mistral': 760, 'n_tokens_neox': 715, 'n_words': 234}