<commit_before>name: Python tests

on:
  push:
    paths:
      - '**.py'
      - 'requirements/*.txt'
  pull_request:
    paths:
      - '**.py'
      - 'requirements/*.txt'

jobs:
  unit_test:
    name: Python unit tests
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 5
      matrix:
        python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install tox
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: tox env cache
      uses: actions/cache@v2
      with:
        path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
        key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
        restore-keys: |
          ${{ runner.os }}-tox-py${{ matrix.python-version }}
    - name: Test with tox
      run: tox -e py${{ matrix.python-version }}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
  postgres:
    name: Python postgres unit tests
    runs-on: ubuntu-latest
    services:
      # Label used to access the service container
      postgres:
        # Docker Hub image
        image: postgres
        # Provide the password for postgres
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
          POSTGRES_DB: test
        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps tcp port 5432 on service container to the host
          - 5432:5432
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.5 for Postgres
      uses: actions/setup-python@v2
      with:
        python-version: 3.5
    - name: Install tox
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: tox env cache
      uses: actions/cache@v2
      with:
        path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
        key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
        restore-keys: |
          ${{ runner.os }}-tox-py${{ matrix.python-version }}
    - name: Test with tox
      run: tox -e postgres
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1<commit_msg>Remove restore keys fallback for tox tests.<commit_after>name: Python tests

on:
  push:
    paths:
      - '**.py'
      - 'requirements/*.txt'
  pull_request:
    paths:
      - '**.py'
      - 'requirements/*.txt'

jobs:
  unit_test:
    name: Python unit tests
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 5
      matrix:
        python-version: [2.7, 3.4, 3.5, 3.6, 3.7, 3.8]

    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install tox
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: tox env cache
      uses: actions/cache@v2
      with:
        path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
        key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
    - name: Test with tox
      run: tox -e py${{ matrix.python-version }}
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
  postgres:
    name: Python postgres unit tests
    runs-on: ubuntu-latest
    services:
      # Label used to access the service container
      postgres:
        # Docker Hub image
        image: postgres
        # Provide the password for postgres
        env:
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: <PASSWORD>
          POSTGRES_DB: test
        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # Maps tcp port 5432 on service container to the host
          - 5432:5432
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.5 for Postgres
      uses: actions/setup-python@v2
      with:
        python-version: 3.5
    - name: Install tox
      run: |
        python -m pip install --upgrade pip
        pip install tox
    - name: tox env cache
      uses: actions/cache@v2
      with:
        path: ${{ github.workspace }}/.tox/py${{ matrix.python-version }}
        key: ${{ runner.os }}-tox-py${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }}
    - name: Test with tox
      run: tox -e postgres
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
{'fraction_non_alphanumeric': 0.12127916331456154, 'fraction_numerical': 0.016492357200321803, 'mean_word_length': 1.9014002333722286, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '4592844', 'n_tokens_mistral': 1647, 'n_tokens_neox': 1531, 'n_words': 437}