<commit_before>name: Build, check & tests with pytest

on:
  pull_request:
    branches:
      - develop
      - django4

jobs:
  build-and-test:
    name: Build, check & test
    # Run on a Ubuntu VM
    runs-on: ubuntu-latest
    env:
      DJANGO_SETTINGS_MODULE: volunteer_planner.settings.tests
    steps:
      # Checkout the GitHub repo
      - uses: actions/checkout@v2

      # Install Python 3.8
      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: "3.9"

      # Pip install project dependencies
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements/dev.txt

      # Check for missing messages in .po files
      - name: Check messages
        run: |
          python manage.py makemessages --all --no-wrap --no-location --no-obsolete
          git diff --ignore-matching-lines=POT-Creation-Date --exit-code

      # Check for missing Django migrations
      - name: Check migrations
        run: python manage.py makemigrations --check

      # Run pytest
      - name: Test /w pytest
        run: pytest -vv<commit_msg>Also install gettext in workflow<commit_after>name: Build, check & tests with pytest

on:
  pull_request:
    branches:
      - develop
      - django4

jobs:
  build-and-test:
    name: Build, check & test
    # Run on a Ubuntu VM
    runs-on: ubuntu-latest
    env:
      DJANGO_SETTINGS_MODULE: volunteer_planner.settings.tests
    steps:
      # Checkout the GitHub repo
      - uses: actions/checkout@v2

      # Install Python 3.8
      - name: Set up Python 3.9
        uses: actions/setup-python@v2
        with:
          python-version: "3.9"

      # apt install system dependencies
      - name: Install apt packages
        run: |
          sudo apt install -y gettext 

      # Pip install project dependencies
      - name: Install python packages
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements/dev.txt

      # Check for missing messages in .po files
      - name: Check messages
        run: |
          python manage.py makemessages --all --no-wrap --no-location --no-obsolete
          git diff --ignore-matching-lines=POT-Creation-Date --exit-code

      # Check for missing Django migrations
      - name: Check migrations
        run: python manage.py makemigrations --check

      # Run pytest
      - name: Test /w pytest
        run: pytest -vv
{'fraction_non_alphanumeric': 0.0819277108433735, 'fraction_numerical': 0.007228915662650603, 'mean_word_length': 1.8797687861271677, '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': '6316207', 'n_tokens_mistral': 747, 'n_tokens_neox': 721, 'n_words': 236}