<commit_before>name: Build

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

env:
  PIP_DISABLE_PIP_VERSION_CHECK: 1

defaults:
  run:
    shell: bash -l {0}

jobs:
  build:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup conda
      uses: conda-incubator/setup-miniconda@v2
      with:
        activate-environment: bqplot-test
        environment-file: test-environment.yml
        python-version: ${{ matrix.python-version }}
        mamba-version: "*"
        auto-activate-base: false
        channels: conda-forge

    - name: Install the package
      run: |
        pip install .

    - name: Test installation files
      run: |
        test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot
        test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/extension.js
        test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/index.js
        test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot
        test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot/package.json
        test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot/static

    - name: Validate the nbextension
      run: jupyter nbextension list 2>&1 | grep "bqplot/extension"

    - name: Validate the labextension
      run: jupyter labextension list 2>&1 | grep bqplot

    - name: Discover typos with codespell
      run: codespell --ignore-words-list="afterall,curvelinear,hist" --skip="./share,./.git/*,./js/node_modules/*,./js/dist/*,*.csv,*.json,*.lock,*.map"

    - name: Python PEP8 check
      run: flake8 bqplot --ignore=E501,W504,W503

    - name: JavaScript prettyfier
      run: |
        yarn install
        yarn run prettier --check .
      working-directory: js

    - name: Python tests
      run: pytest tests examples/Marks

    - name: JavaScript tests
      run: yarn run test
      working-directory: js

    - name: Build Python package
      run: |
        python setup.py sdist bdist_wheel
        cd dist
        sha256sum * | tee SHA256SUMS

    - name: Pack JavaScript package
      run: |
        yarn pack
        mv bqplot*.tgz ../dist
      working-directory: js

    - name: Upload builds
      uses: actions/upload-artifact@v2
      with:
        name: dist ${{ github.run_number }}
        path: ./dist

  visual-regression-tests:
    runs-on: ubuntu-latest
    needs: [build]

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: bqplot-test
          environment-file: test-environment.yml
          python-version: 3.9
          mamba-version: "*"
          auto-activate-base: false
          channels: conda-forge

      - uses: actions/download-artifact@v2
        with:
          name: dist ${{ github.run_number }}
          path: ./dist

      - name: Install the package
        run: pip install -vv bqplot*.whl
        working-directory: dist

      - name: Install Galata
        run: |
          yarn install
          yarn playwright install chromium
        working-directory: ui-tests

      - name: Launch JupyterLab
        run: yarn run start:detached
        working-directory: ui-tests

      - name: Wait for JupyterLab
        uses: ifaxity/wait-on-action@v1
        with:
          resource: http-get://localhost:8888/api
          timeout: 20000

      - name: Run UI Tests
        run: yarn run test
        working-directory: ui-tests

      - name: Upload UI Test artifacts
        if: always()
        uses: actions/upload-artifact@v2
        with:
          name: ui-test-output
          path: ui-tests/playwright-report

      - name: Update snapshots
        if: failure()
        run: |
          cd ui-tests
          yarn run test:update

      - name: Upload updated snapshots
        if: failure()
        uses: actions/upload-artifact@v2
        with:
          name: ipywidgets-updated-snapshots
          path: ui-tests/tests

  install:
    runs-on: ${{ matrix.os }}-latest
    needs: [build]

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu, macos, windows]
        python: ['3.6', '3.9']
        include:
          - python: '3.6'
            dist: 'bqplot*.tar.gz'
          - python: '3.9'
            dist: 'bqplot*.whl'

    steps:

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: bqplot-test
          environment-file: test-environment.yml
          python-version: ${{ matrix.python-version }}
          mamba-version: "*"
          auto-activate-base: false
          channels: conda-forge

      - uses: actions/download-artifact@v2
        with:
          name: dist ${{ github.run_number }}
          path: ./dist

      - name: Install the package
        run: |
          cd dist
          pip install -vv ${{ matrix.dist }}

      - name: Test installation files
        run: |
          test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot
          test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/extension.js
          test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/index.js
          test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot
          test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot/package.json
          test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot/static

      - name: Validate the nbextension
        run: jupyter nbextension list 2>&1 | grep "bqplot/extension"

      - name: Validate the labextension
        run: jupyter labextension list 2>&1 | grep bqplot

  JupyterLab2-build:
    runs-on: ${{ matrix.os }}-latest
    needs: [build]

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu]
        python: ['3.9']

    steps:

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          python-version: ${{ matrix.python-version }}
          mamba-version: "*"
          channels: conda-forge

      - uses: actions/download-artifact@v2
        with:
          name: dist ${{ github.run_number }}
          path: ./dist

      - name: Install JupyterLab 2
        run: mamba install yarn jupyterlab=2

      - name: Install the labextension
        env:
          NODE_OPTIONS: --openssl-legacy-provider
        run: jupyter labextension install dist/bqplot*.tgz --debug
<commit_msg>CI: Remove "update snapshots" step<commit_after>name: Build

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

env:
  PIP_DISABLE_PIP_VERSION_CHECK: 1

defaults:
  run:
    shell: bash -l {0}

jobs:
  build:
    runs-on: ubuntu-latest
    steps:

    - name: Checkout
      uses: actions/checkout@v2

    - name: Setup conda
      uses: conda-incubator/setup-miniconda@v2
      with:
        activate-environment: bqplot-test
        environment-file: test-environment.yml
        python-version: ${{ matrix.python-version }}
        mamba-version: "*"
        auto-activate-base: false
        channels: conda-forge

    - name: Install the package
      run: |
        pip install .

    - name: Test installation files
      run: |
        test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot
        test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/extension.js
        test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/index.js
        test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot
        test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot/package.json
        test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot/static

    - name: Validate the nbextension
      run: jupyter nbextension list 2>&1 | grep "bqplot/extension"

    - name: Validate the labextension
      run: jupyter labextension list 2>&1 | grep bqplot

    - name: Discover typos with codespell
      run: codespell --ignore-words-list="afterall,curvelinear,hist" --skip="./share,./.git/*,./js/node_modules/*,./js/dist/*,*.csv,*.json,*.lock,*.map"

    - name: Python PEP8 check
      run: flake8 bqplot --ignore=E501,W504,W503

    - name: JavaScript prettyfier
      run: |
        yarn install
        yarn run prettier --check .
      working-directory: js

    - name: Python tests
      run: pytest tests examples/Marks

    - name: JavaScript tests
      run: yarn run test
      working-directory: js

    - name: Build Python package
      run: |
        python setup.py sdist bdist_wheel
        cd dist
        sha256sum * | tee SHA256SUMS

    - name: Pack JavaScript package
      run: |
        yarn pack
        mv bqplot*.tgz ../dist
      working-directory: js

    - name: Upload builds
      uses: actions/upload-artifact@v2
      with:
        name: dist ${{ github.run_number }}
        path: ./dist

  visual-regression-tests:
    runs-on: ubuntu-latest
    needs: [build]

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: bqplot-test
          environment-file: test-environment.yml
          python-version: 3.9
          mamba-version: "*"
          auto-activate-base: false
          channels: conda-forge

      - uses: actions/download-artifact@v2
        with:
          name: dist ${{ github.run_number }}
          path: ./dist

      - name: Install the package
        run: pip install -vv bqplot*.whl
        working-directory: dist

      - name: Install Galata
        run: |
          yarn install
          yarn playwright install chromium
        working-directory: ui-tests

      - name: Launch JupyterLab
        run: yarn run start:detached
        working-directory: ui-tests

      - name: Wait for JupyterLab
        uses: ifaxity/wait-on-action@v1
        with:
          resource: http-get://localhost:8888/api
          timeout: 20000

      - name: Run UI Tests
        run: yarn run test
        working-directory: ui-tests

      - name: Upload UI Test artifacts
        if: always()
        uses: actions/upload-artifact@v2
        with:
          name: ui-test-output
          path: |
            ui-tests/playwright-report
            ui-tests/test-results

  install:
    runs-on: ${{ matrix.os }}-latest
    needs: [build]

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu, macos, windows]
        python: ['3.6', '3.9']
        include:
          - python: '3.6'
            dist: 'bqplot*.tar.gz'
          - python: '3.9'
            dist: 'bqplot*.whl'

    steps:

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          activate-environment: bqplot-test
          environment-file: test-environment.yml
          python-version: ${{ matrix.python-version }}
          mamba-version: "*"
          auto-activate-base: false
          channels: conda-forge

      - uses: actions/download-artifact@v2
        with:
          name: dist ${{ github.run_number }}
          path: ./dist

      - name: Install the package
        run: |
          cd dist
          pip install -vv ${{ matrix.dist }}

      - name: Test installation files
        run: |
          test -d $CONDA_PREFIX/share/jupyter/nbextensions/bqplot
          test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/extension.js
          test -f $CONDA_PREFIX/share/jupyter/nbextensions/bqplot/index.js
          test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot
          test -f $CONDA_PREFIX/share/jupyter/labextensions/bqplot/package.json
          test -d $CONDA_PREFIX/share/jupyter/labextensions/bqplot/static

      - name: Validate the nbextension
        run: jupyter nbextension list 2>&1 | grep "bqplot/extension"

      - name: Validate the labextension
        run: jupyter labextension list 2>&1 | grep bqplot

  JupyterLab2-build:
    runs-on: ${{ matrix.os }}-latest
    needs: [build]

    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu]
        python: ['3.9']

    steps:

      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          python-version: ${{ matrix.python-version }}
          mamba-version: "*"
          channels: conda-forge

      - uses: actions/download-artifact@v2
        with:
          name: dist ${{ github.run_number }}
          path: ./dist

      - name: Install JupyterLab 2
        run: mamba install yarn jupyterlab=2

      - name: Install the labextension
        env:
          NODE_OPTIONS: --openssl-legacy-provider
        run: jupyter labextension install dist/bqplot*.tgz --debug

{'fraction_non_alphanumeric': 0.10198035240916888, 'fraction_numerical': 0.010213628566973335, 'mean_word_length': 1.8915689810640217, 'pattern_counts': {'":': 0, '<': 3, '<?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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5870654', 'n_tokens_mistral': 4247, 'n_tokens_neox': 4016, 'n_words': 931}