<commit_before>name: CI
on: [push, pull_request]
jobs:
  test:
    name: Test
    strategy:
      matrix:
        python-version: ['3.6.x', '3.7.x', '3.8.x']
        django-version: ['2.1.15', '2.2.16', '3.0.10', '3.1.1']
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v1

    - name: Install Python
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Initialize environment
      run: |
        python -m pip install -U pip poetry
        poetry install
        poetry run pip install -q django==${{ matrix.django-version }}

    - name: Run tests
      run: |
        poetry run flake8
        poetry run py.test --cov-report=xml --cov=hamlpy hamlpy

    - name: Upload coverage
      if: success()
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        fail_ci_if_error: true<commit_msg>Add release job to CI workflow<commit_after>name: CI
on: [push, pull_request]
jobs:
  test:
    name: Test
    strategy:
      matrix:
        python-version: ['3.6.x', '3.7.x', '3.8.x']
        django-version: ['2.1.15', '2.2.16', '3.0.10', '3.1.1']
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v1

    - name: Install Python
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}

    - name: Initialize environment
      run: |
        python -m pip install -U pip poetry
        poetry install
        poetry run pip install -q django==${{ matrix.django-version }}

    - name: Run tests
      run: |
        poetry run flake8
        poetry run py.test --cov-report=xml --cov=hamlpy hamlpy

    - name: Upload coverage
      if: success()
      uses: codecov/codecov-action@v1
      with:
        token: ${{ secrets.CODECOV_TOKEN }}
        fail_ci_if_error: true

  release:
    name: Release
    needs: [test]
    if: startsWith(github.ref, 'refs/tags/')
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v1

    - name: Install Python
      uses: actions/setup-python@v1
      with:
        python-version: '3.8.x'

    - name: Publish release
      run: |
        python -m pip install -U pip poetry
        poetry build
        poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
        poetry publish
{'fraction_non_alphanumeric': 0.12510425354462051, 'fraction_numerical': 0.022518765638031693, 'mean_word_length': 2.010037641154329, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4477324', 'n_tokens_mistral': 818, 'n_tokens_neox': 800, 'n_words': 209}