<commit_before>name: Linux

on:
  push:
  pull_request:

jobs:
  build:
    env:
      DISPLAY: ":0"  # arbitrary

    runs-on: ubuntu-latest
    services:
      mongodb:
        image: mongo
        ports:
        - 27017:27017

    strategy:
      matrix:
        python-version: [3.7, 3.8, 3.9]
        numpy-version: ["1.20"]

      fail-fast: false

    steps:
    - uses: actions/checkout@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install Linux libraries
      if: runner.os == 'Linux'
      shell: bash -l {0}
      run: |
        sudo apt-get install -y xvfb
        sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
        sleep 3
        # sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &

    - name:  Install 'herbstluftwm' (on Linux only)
      run: |
        sudo apt-get update
        sudo apt-get install -y xvfb herbstluftwm
        herbstluftwm &
        sleep 1

    - name: Install Miniconda
      shell: bash -l {0}
      run: |
        set -vxeuo pipefail

        # Install miniconda
        arch="Linux"
        wget https://repo.continuum.io/miniconda/Miniconda3-latest-${arch}-x86_64.sh -O miniconda.sh
        chmod +x miniconda.sh
        ./miniconda.sh -b -p ~/mc
        source ~/mc/etc/profile.d/conda.sh
        conda update conda --yes
        export CONDARC=ci/condarc

    - name: Create conda environment
      shell: bash -l {0}
      run: |
        set -vxeuo pipefail
        conda create -y -n testenv python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} pyqt numba -c conda-forge
        # Note: 'numba' fails to install properly from PyPI on OSX
        conda activate testenv

    - name: Install required conda packages
      shell: bash -l {0}
      run: |
        set -vxeuo pipefail

        conda install -y 'scikit-beam>=0.0.24' -c conda-forge<commit_msg>CI: use GH action to install miniconda<commit_after>name: Linux

on:
  push:
  pull_request:

jobs:
  build:
    env:
      DISPLAY: ":0"  # arbitrary

    runs-on: ubuntu-latest
    services:
      mongodb:
        image: mongo
        ports:
        - 27017:27017

    strategy:
      matrix:
        python-version: [3.7, 3.8, 3.9]
        numpy-version: ["1.20"]

      fail-fast: false

    steps:
    - uses: actions/checkout@v2
    - uses: conda-incubator/setup-miniconda@v2

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install Linux libraries
      if: runner.os == 'Linux'
      shell: bash -l {0}
      run: |
        sudo apt-get install -y xvfb
        sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
        sleep 3
        # sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &

    - name:  Install 'herbstluftwm' (on Linux only)
      run: |
        sudo apt-get update
        sudo apt-get install -y xvfb herbstluftwm
        herbstluftwm &
        sleep 1


    - name: Install Miniconda
      shell: bash -l {0}
      run: |
        set -vxeuo pipefail

        # Install miniconda
        # arch="Linux"
        # wget https://repo.continuum.io/miniconda/Miniconda3-latest-${arch}-x86_64.sh -O miniconda.sh
        # chmod +x miniconda.sh
        # ./miniconda.sh -b -p ~/mc
        # source ~/mc/etc/profile.d/conda.sh
        # conda update conda --yes
        # export CONDARC=ci/condarc

    - name: Create conda environment
      shell: bash -l {0}
      run: |
        set -vxeuo pipefail
        conda create -y -n testenv python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} pyqt numba -c conda-forge
        # Note: 'numba' fails to install properly from PyPI on OSX
        conda activate testenv

    - name: Install required conda packages
      shell: bash -l {0}
      run: |
        set -vxeuo pipefail

        conda install -y 'scikit-beam>=0.0.24' -c conda-forge
{'fraction_non_alphanumeric': 0.11415204678362573, 'fraction_numerical': 0.029707602339181287, 'mean_word_length': 1.885290148448043, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '346644', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1448, 'n_words': 395}