<commit_before>---
name: CI

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]
  workflow_dispatch:

env:
  FORCE_COLOR: "1"  # Make tools pretty.
  TOX_TESTENV_PASSENV: "FORCE_COLOR"
  PYTHON_LATEST: "3.10"


jobs:
  tests:
    name: "tox on ${{ matrix.python-version }}"
    runs-on: "ubuntu-latest"
    strategy:
      matrix:
        python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.7"]

    steps:
      - uses: "actions/checkout@v2"
      - uses: "actions/setup-python@v2"
        with:
          python-version: "${{ matrix.python-version }}"
      - name: "Install dependencies"
        run: |
          python -VV
          python -m site
          python -m pip install --upgrade pip setuptools wheel
          python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions

      - name: "Run tox targets for ${{ matrix.python-version }}"
        run: "python -m tox"

      - name: Upload coverage data
        uses: "actions/upload-artifact@v2"
        with:
          name: coverage-data
          path: ".coverage.*"
          if-no-files-found: ignore


  coverage:
    runs-on: "ubuntu-latest"
    needs: tests

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          # Use latest Python, so it understands all syntax.
          python-version: ${{env.PYTHON_LATEST}}

      - name: "Install Coverage.py"
        run: "python -m pip install --upgrade coverage[toml]"

      - name: "Download coverage data"
        uses: actions/download-artifact@v2
        with:
          name: coverage-data

      - run: python -m coverage combine
      - run: python -m coverage html --skip-covered --skip-empty

      - name: Upload coverage report
        uses: "actions/upload-artifact@v2"
        with:
          name: html-report
          path: htmlcov

      - run: python -m coverage report --fail-under=100


  system-package:
    runs-on: "ubuntu-latest"
    name: "Install and test with system package of Argon2."

    steps:
      - uses: "actions/checkout@v2"
      - uses: "actions/setup-python@v2"
        with:
          python-version: ${{env.PYTHON_LATEST}}
      - name: "Install dependencies"
        run: |
          sudo apt-get install libargon2-0 libargon2-0-dev
          python -VV
          python -m site
          python -m pip install --upgrade pip setuptools wheel
          python -m pip install --upgrade virtualenv tox

      - name: "Run tox -e system-argon2"
        run: "python -m tox -e system-argon2"


  package:
    name: "Build & verify package"
    runs-on: "ubuntu-latest"

    steps:
      - uses: "actions/checkout@v2"<commit_msg>Only upload HTML report if coverage check failed (#109)<commit_after>---
name: CI

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]
  workflow_dispatch:

env:
  FORCE_COLOR: "1"  # Make tools pretty.
  TOX_TESTENV_PASSENV: "FORCE_COLOR"
  PYTHON_LATEST: "3.10"


jobs:
  tests:
    name: "tox on ${{ matrix.python-version }}"
    runs-on: "ubuntu-latest"
    strategy:
      matrix:
        python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "pypy-3.7"]

    steps:
      - uses: "actions/checkout@v2"
      - uses: "actions/setup-python@v2"
        with:
          python-version: "${{ matrix.python-version }}"
      - name: "Install dependencies"
        run: |
          python -VV
          python -m site
          python -m pip install --upgrade pip setuptools wheel
          python -m pip install --upgrade coverage[toml] virtualenv tox tox-gh-actions

      - name: "Run tox targets for ${{ matrix.python-version }}"
        run: "python -m tox"

      - name: Upload coverage data
        uses: "actions/upload-artifact@v2"
        with:
          name: coverage-data
          path: ".coverage.*"
          if-no-files-found: ignore


  coverage:
    runs-on: "ubuntu-latest"
    needs: tests

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          # Use latest Python, so it understands all syntax.
          python-version: ${{env.PYTHON_LATEST}}

      - name: "Install Coverage.py"
        run: "python -m pip install --upgrade coverage[toml]"

      - name: "Download coverage data"
        uses: actions/download-artifact@v2
        with:
          name: coverage-data

      - run: |
          python -m coverage combine
          python -m coverage html --skip-covered --skip-empty
          python -m coverage report --fail-under=100

      - name: Upload HTML report for failed check
        uses: "actions/upload-artifact@v2"
        with:
          name: html-report
          path: htmlcov
        if: ${{ failure() }}


  system-package:
    runs-on: "ubuntu-latest"
    name: "Install and test with system package of Argon2."

    steps:
      - uses: "actions/checkout@v2"
      - uses: "actions/setup-python@v2"
        with:
          python-version: ${{env.PYTHON_LATEST}}
      - name: "Install dependencies"
        run: |
          sudo apt-get install libargon2-0 libargon2-0-dev
          python -VV
          python -m site
          python -m pip install --upgrade pip setuptools wheel
          python -m pip install --upgrade virtualenv tox

      - name: "Run tox -e system-argon2"
        run: "python -m tox -e system-argon2"


  package:
    name: "Build & verify package"
    runs-on: "ubuntu-latest"

    steps:
      - uses: "actions/checkout@v2"
{'fraction_non_alphanumeric': 0.12098991750687443, 'fraction_numerical': 0.014115490375802016, 'mean_word_length': 1.9396551724137931, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '485527', 'n_tokens_mistral': 1820, 'n_tokens_neox': 1715, 'n_words': 478}