<commit_before>name: Docs

on: [push, pull_request]

jobs:
  Salt:
    name: Build Salt Documentation
    runs-on: ubuntu-latest

    container:
      image: python:3.8.6-slim-buster

    steps:

    - name: Install System Deps
      run: |
        apt-get update
        apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils

    - uses: actions/checkout@v2

    - name: Set Python Version Env Var
      run: |
        echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV

    - name: Install Nox
      run: |
        python -m pip install --upgrade pip
        pip install nox

    - id: changed-files
      name: Get Changed Files
      uses: dorny/paths-filter@v2
      with:
        token: ${{ github.token }}
        list-files: shell
        filters: |
          docs:
            - docs/**

    - name: Set Docs Python Cache Key
      run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV

    - name: Setup Nox Cache
      uses: pat-s/always-upload-cache@v2.1.3
      with:
        path: .nox/
        key: docs-salt|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}

    - name: Install Python Requirements
      env:
        PIP_EXTRA_INDEX_URL: https://artifactory.saltstack.net/artifactory/api/pypi/pypi-open/simple/
      run:
        nox --install-only --forcecolor -e 'docs-html(compress=True, clean=True)'

    - name: Build Docs
      env:
        SKIP_REQUIREMENTS_INSTALL: YES
      run: |
        nox --forcecolor -e 'docs-html(compress=True, clean=True)'

  Manpages:
    name: Build Salt man Pages
    runs-on: ubuntu-latest

    container:
      image: python:3.8.6-slim-buster

    steps:

    - name: Install System Deps
      run: |
        apt-get update
        apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev

    - uses: actions/checkout@v2

    - id: changed-files
      name: Get Changed Files
      uses: dorny/paths-filter@v2
      with:
        token: ${{ github.token }}
        list-files: shell
        filters: |
          docs:
            - docs/**

    - name: Set Python Version Env Var
      if: steps.changed-files.outputs.docs == 'true'
      run: |
        echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV

    - name: Install Nox
      if: steps.changed-files.outputs.docs == 'true'
      run: |
        python -m pip install --upgrade pip
        pip install nox

    - name: Set Docs Python Cache Key
      if: steps.changed-files.outputs.docs == 'true'
      run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV

    - name: Setup Nox Cache
      if: steps.changed-files.outputs.docs == 'true'
      uses: pat-s/always-upload-cache@v2.1.3
      with:
        path: .nox/
        key: docs-man|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}

    - name: Install Python Requirements
      if: steps.changed-files.outputs.docs == 'true'
      env:
        PIP_EXTRA_INDEX_URL: https://artifactory.saltstack.net/artifactory/api/pypi/pypi-open/simple/
      run:
        nox --install-only --forcecolor -e 'docs-man(compress=True, update=False, clean=True)'

    - name: Build Manpages
      if: steps.changed-files.outputs.docs == 'true'
      env:
        SKIP_REQUIREMENTS_INSTALL: YES
      run: |
        nox --forcecolor -e 'docs-man(compress=True, update=False, clean=True)'<commit_msg>Always build man pages on push events<commit_after>name: Docs

on: [push, pull_request]

jobs:
  Salt:
    name: Build Salt Documentation
    runs-on: ubuntu-latest

    container:
      image: python:3.8.6-slim-buster

    steps:

    - name: Install System Deps
      run: |
        apt-get update
        apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils

    - uses: actions/checkout@v2

    - name: Set Python Version Env Var
      run: |
        echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV

    - name: Install Nox
      run: |
        python -m pip install --upgrade pip
        pip install nox

    - id: changed-files
      name: Get Changed Files
      uses: dorny/paths-filter@v2
      with:
        token: ${{ github.token }}
        list-files: shell
        filters: |
          docs:
            - docs/**

    - name: Set Docs Python Cache Key
      run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV

    - name: Setup Nox Cache
      uses: pat-s/always-upload-cache@v2.1.3
      with:
        path: .nox/
        key: docs-salt|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}

    - name: Install Python Requirements
      env:
        PIP_EXTRA_INDEX_URL: https://artifactory.saltstack.net/artifactory/api/pypi/pypi-open/simple/
      run:
        nox --install-only --forcecolor -e 'docs-html(compress=True, clean=True)'

    - name: Build Docs
      env:
        SKIP_REQUIREMENTS_INSTALL: YES
      run: |
        nox --forcecolor -e 'docs-html(compress=True, clean=True)'

  Manpages:
    name: Build Salt man Pages
    runs-on: ubuntu-latest

    container:
      image: python:3.8.6-slim-buster

    steps:

    - name: Install System Deps
      run: |
        apt-get update
        apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev

    - uses: actions/checkout@v2

    - id: changed-files
      name: Get Changed Files
      uses: dorny/paths-filter@v2
      with:
        token: ${{ github.token }}
        list-files: shell
        filters: |
          docs:
            - docs/**

    - name: Set Python Version Env Var
      if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
      run: |
        echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV

    - name: Install Nox
      if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
      run: |
        python -m pip install --upgrade pip
        pip install nox

    - name: Set Docs Python Cache Key
      if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
      run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV

    - name: Setup Nox Cache
      if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
      uses: pat-s/always-upload-cache@v2.1.3
      with:
        path: .nox/
        key: docs-man|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}

    - name: Install Python Requirements
      if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
      env:
        PIP_EXTRA_INDEX_URL: https://artifactory.saltstack.net/artifactory/api/pypi/pypi-open/simple/
      run:
        nox --install-only --forcecolor -e 'docs-man(compress=True, update=False, clean=True)'

    - name: Build Manpages
      if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
      env:
        SKIP_REQUIREMENTS_INSTALL: YES
      run: |
        nox --forcecolor -e 'docs-man(compress=True, update=False, clean=True)'
{'fraction_non_alphanumeric': 0.13390985324947588, 'fraction_numerical': 0.009958071278825996, 'mean_word_length': 2.2522368981678738, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '7189404', 'n_tokens_mistral': 2686, 'n_tokens_neox': 2522, 'n_words': 617}