<commit_before># This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        mpi: ['mpi4py', 'none']
        backend: ['dummy']
    steps:
    - uses: actions/checkout@v2
    - uses: conda-incubator/setup-miniconda@v2
      with:
        python-version: 2.7
    - name: Install base dependencies
      shell: bash -l {0}
      run: |
        # $CONDA is an environment variable pointing to the root of the miniconda directory
        # $CONDA/bin/conda env update --file environment.yml --name base
        # Install requirements except for h5writer and pint which must be from pip
        # Also PyQt5 called pyqt in conda and will be installed automatically with the other dependencies
        pip install Pint
        conda install --yes h5py pexpect pyqtgraph scipy pyzmq tornado pytz
        pip install h5writer
    - name: Install mpi
      shell: bash -l {0}
      run: conda install --yes ${{ matrix.mpi }}
      if: matrix.mpi != 'none'
    - name: Lint with flake8
      shell: bash -l {0}
      run: |
        conda install flake8
        # stop the build if there are Python syntax errors or undefined names
        # $CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        # $CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
    - name: Test with pytest
      shell: bash -l {0}
      run: |
        # subprocess32 is necessary for testing under python2.7
        conda install subprocess32
        conda install pytest
        pytest<commit_msg>Initial container run test<commit_after># This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  dummy-build:

    runs-on: ubuntu-latest
    strategy:
      matrix:
        mpi: ['mpi4py', 'none']
    steps:
    - uses: actions/checkout@v2
    - uses: conda-incubator/setup-miniconda@v2
      with:
        python-version: 2.7
    - name: Install base dependencies
      shell: bash -l {0}
      run: |
        # $CONDA is an environment variable pointing to the root of the miniconda directory
        # $CONDA/bin/conda env update --file environment.yml --name base
        # Install requirements except for h5writer and pint which must be from pip
        # Also PyQt5 called pyqt in conda and will be installed automatically with the other dependencies
        pip install Pint
        conda install --yes h5py pexpect pyqtgraph scipy pyzmq tornado pytz
        pip install h5writer
    - name: Install mpi
      shell: bash -l {0}
      run: conda install --yes ${{ matrix.mpi }}
      if: matrix.mpi != 'none'
    - name: Lint with flake8
      shell: bash -l {0}
      run: |
        conda install flake8
        # stop the build if there are Python syntax errors or undefined names
        # $CONDA/bin/flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
        # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
        # $CONDA/bin/flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
    - name: Test with pytest
      shell: bash -l {0}
      run: |
        # subprocess32 is necessary for testing under python2.7
        conda install subprocess32
        conda install pytest
        pytest

  lcls-build:
    runs-on: ubuntu-latest
    container:
      image: filipemaia/hummingbird-testing
      volumes:
        - ${HOME}/data:/opt/data
    steps:
    - uses: actions/checkout@v2
    - name: Cache data
      uses: actions/cache@v2
      with:
        path: /opt/data
        key: xtc-data
        restore-keys: xtc-data
    - name: Prepare data
      shell: bash -l {0}
      run: |
        cd /opt/data
        '[ -f e41-r0073-s00-c00.xtc ] && echo "File already exists" || wget http://davinci.icm.uu.se/wp-content/uploads/xtc/e41-r0073-s00-c00.xtc'
        '[ -f e41-r0092-s00-c00.xtc ] && echo "File already exists" || wget http://davinci.icm.uu.se/wp-content/uploads/xtc/e41-r0092-s00-c00.xtc'
    - name: LCLS Test Run
      shell: bash -l {0}
      run: |
        source /reg/g/psdm/etc/ana_env.sh && mkdir -p /reg/d/psdm/AMO/amo15010 && ln -s /opt/data /reg/d/psdm/AMO/amo15010/xtc && /reg/g/psdm/sw/external/python/2.7.10/x86_64-rhel6-gcc44-opt/bin/pip install pint==0.9 && cd ${HOME} && /reg/g/psdm/sw/external/python/2.7.10/x86_64-rhel6-gcc44-opt/bin/coverage run --source src -m py.test  -v --color=yes --showlocals --durations=10
{'fraction_non_alphanumeric': 0.10521140609636184, 'fraction_numerical': 0.030285152409046213, 'mean_word_length': 2.3111979166666665, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1056488', 'n_tokens_mistral': 1732, 'n_tokens_neox': 1644, 'n_words': 500}