<commit_before>name: Testing - Linux

on: [push, pull_request]

jobs:

  test:
    strategy:
      max-parallel: 20
      matrix:
        os: [ubuntu-latest]
        python-version: [3.8]
        pkg: [analysis, others]

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2

    - uses: conda-incubator/setup-miniconda@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install OpenBabel and Libs
      shell: bash -l {0}
      run: |
        # Required for gulp.
        sudo apt-get install csh gfortran libgfortran3
        conda install -c conda-forge openbabel

    - name: Install dependencies
      shell: bash -l {0}
      run: |
        # Note that this is the way to update env variables in a way that persist for the entire job.
        for pkg in `ls cmd_line`; do echo "`pwd`/cmd_line/$pkg/Linux_64bit" >> $GITHUB_PATH; done
        echo "GULP_LIB=`pwd`/cmd_line/gulp/Libraries" >> $GITHUB_ENV
        echo "PMG_TEST_FILES_DIR=`pwd`/test_files" >> $GITHUB_ENV
        pip install --upgrade pip wheel
        pip install -r requirements.txt
        pip install -r requirements-optional.txt
        pip install -r requirements-dev.txt
        pip install -e .
    - name: pytest ${{ matrix.pkg }}
      shell: bash -l {0}
      if: matrix.pkg != 'others'
      env:
        PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
        MPLBACKEND: "Agg"
      run: |
        pytest pymatgen/${{ matrix.pkg }} -rxXs --color=yes --cov=pymatgen
    - name: pytest others
      shell: bash -l {0}
      if: matrix.pkg == 'others'
      env:
        PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
        MPLBACKEND: "Agg"
      run: |
        pytest pymatgen -rxXs --color=yes --cov=pymatgen --ignore=pymatgen/analysis
    - name: Upload coverage
      uses: actions/upload-artifact@v1
      with:
        name: coverage${{ matrix.pkg }}
        path: .coverage

  coverage:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install deps
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements-dev.txt
    - name: Download coverageanalysis
      uses: actions/download-artifact@v1
      with:
        name: coverageanalysis
    - name: Download coverageothers
      uses: actions/download-artifact@v1
      with:
        name: coverageothers
    - name: Run coverage
      run: |
        coverage combine coverage*/.coverage*
        coverage report
        coverage xml
    - name: Coveralls Python
      uses: AndreMiras/coveralls-python-action@v20201129<commit_msg>More workflow speedups.<commit_after>name: Testing - Linux

on: [push, pull_request]

jobs:

  test:
    strategy:
      max-parallel: 20
      matrix:
        os: [ubuntu-latest]
        python-version: [3.8]
        pkg: [analysis, others]

    runs-on: ${{ matrix.os }}

    steps:
    - uses: actions/checkout@v2

    - uses: conda-incubator/setup-miniconda@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Cache pip
      uses: actions/cache@v2
      with:
        path: ~/.cache/pip
        key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-optional.txt') }}
        restore-keys: |
          ${{ runner.os }}-pip-
          ${{ runner.os }}-
    - name: Install OpenBabel and Libs
      shell: bash -l {0}
      run: |
        # Required for gulp.
        sudo apt-get install csh gfortran libgfortran3
        conda install -c conda-forge openbabel

    - name: Install dependencies
      shell: bash -l {0}
      run: |
        # Note that this is the way to update env variables in a way that persist for the entire job.
        for pkg in `ls cmd_line`; do echo "`pwd`/cmd_line/$pkg/Linux_64bit" >> $GITHUB_PATH; done
        echo "GULP_LIB=`pwd`/cmd_line/gulp/Libraries" >> $GITHUB_ENV
        echo "PMG_TEST_FILES_DIR=`pwd`/test_files" >> $GITHUB_ENV
        pip install --upgrade pip wheel
        pip install -r requirements.txt
        pip install -r requirements-optional.txt
        pip install -r requirements-dev.txt
        pip install -e .
    - name: pytest ${{ matrix.pkg }}
      shell: bash -l {0}
      if: matrix.pkg != 'others'
      env:
        PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
        MPLBACKEND: "Agg"
      run: |
        pytest pymatgen/${{ matrix.pkg }} -rxXs --color=yes --cov=pymatgen
    - name: pytest others
      shell: bash -l {0}
      if: matrix.pkg == 'others'
      env:
        PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }}
        MPLBACKEND: "Agg"
      run: |
        pytest pymatgen -rxXs --color=yes --cov=pymatgen --ignore=pymatgen/analysis
    - name: Upload coverage
      uses: actions/upload-artifact@v1
      with:
        name: coverage${{ matrix.pkg }}
        path: .coverage

  coverage:
    needs: test
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.8
      uses: actions/setup-python@v1
      with:
        python-version: 3.8
    - name: Install deps
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements-dev.txt
    - name: Download coverageanalysis
      uses: actions/download-artifact@v1
      with:
        name: coverageanalysis
    - name: Download coverageothers
      uses: actions/download-artifact@v1
      with:
        name: coverageothers
    - name: Run coverage
      run: |
        coverage combine coverage*/.coverage*
        coverage report
        coverage xml
    - name: Coveralls Python
      uses: AndreMiras/coveralls-python-action@v20201129
{'fraction_non_alphanumeric': 0.11105263157894738, 'fraction_numerical': 0.010701754385964912, 'mean_word_length': 2.045405982905983, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5813695', 'n_tokens_mistral': 1922, 'n_tokens_neox': 1833, 'n_words': 488}