<commit_before>name: Generate Coverage Badge

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Install dependencies
        run: pip install -r requirements/test.txt
      - name: Set coverage percentage
        run: |
          echo "COVERAGE=$(pytest | awk '$1 == "TOTAL" {print $NF+0}')%" >> $GITHUB_ENV
          REF=${{ github.ref }}
          IFS='/' read -ra PATHS <<< "$REF"
          BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
          echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV
      - name: Generate coverage badge
        uses: schneegans/dynamic-badges-action@v1.1.0
        with:
          auth: ${{ secrets.GIST_SECRET }}
          gistID: bc746d7bfe356b54fbb93b2ea5d0d2a4
          filename: FQM__${{ env.BRANCH }}.json
          label: coverage
          message: ${{ env.COVERAGE }}<commit_msg>fix coverage generator command<commit_after>name: Generate Coverage Badge

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Install dependencies
        run: pip install -r requirements/test.txt
      - name: Set coverage percentage
        run: |
          echo "COVERAGE=$(pytest --verbose --cov=app | awk '$1 == "TOTAL" {print $NF+0}')%" >> $GITHUB_ENV
          REF=${{ github.ref }}
          IFS='/' read -ra PATHS <<< "$REF"
          BRANCH_NAME="${PATHS[1]}_${PATHS[2]}"
          echo "BRANCH=$(echo ${BRANCH_NAME})" >> $GITHUB_ENV
      - name: Generate coverage badge
        uses: schneegans/dynamic-badges-action@v1.1.0
        with:
          auth: ${{ secrets.GIST_SECRET }}
          gistID: bc746d7bfe356b54fbb93b2ea5d0d2a4
          filename: FQM__${{ env.BRANCH }}.json
          label: coverage
          message: ${{ env.COVERAGE }}
{'fraction_non_alphanumeric': 0.1341991341991342, 'fraction_numerical': 0.025974025974025976, 'mean_word_length': 2.086053412462908, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '3196309', 'n_tokens_mistral': 736, 'n_tokens_neox': 707, 'n_words': 157}