<commit_before>name: build

on:
    pull_request:
    push:
        branches:
            - master
        tags:
          - '*'

jobs:
  cleanup-runs:
    runs-on: ubuntu-latest
    steps:
    - uses: rokroskar/workflow-run-cleanup-action@master
      env:
        GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
    if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

  linters:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: isort
        uses: jamescurtin/isort-action@master
      - name: flake8
        uses: py-actions/flake8@v1

  build:
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        shell: bash -l {0}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-18.04, macos-11, windows-2019 ]
        python-version: [ 3.7, 3.9, "3.10" ]
        include:
          - os: ubuntu-18.04
            python-version: 3.8
            openmp: "True"
          - os: ubuntu-18.04
            python-version: 3.8
          - os: macos-11
            python-version: 3.8
            single_action_config: "True"
          - os: windows-2019
            python-version: 3.8

    env:
      RUNNER_OS: ${{ matrix.os }}
      PYTHON_VERSION: ${{ matrix.python-version }}
      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' && 'True' || 'False' }}"
      USE_OPENMP: "${{ matrix.openmp == 'True' && 'True' || 'False' }}"
      MOSEK_CI_BASE64: ${{ secrets.MOSEK_CI_BASE64 }}

    steps:
      - uses: actions/checkout@v2
      - name: Set Additional Envs
        run: |
          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
          echo $MOSEK_CI_BASE64 | base64 -d > mosek.lic
          echo "MOSEKLM_LICENSE_FILE=$( [[ $RUNNER_OS == 'macOS' ]] && echo $(pwd)/mosek.lic || echo $(realpath mosek.lic) )" >> $GITHUB_ENV
      - uses: conda-incubator/setup-miniconda@v2
        with:
          auto-update-conda: true
          python-version: ${{ matrix.python-version }}
          channels: conda-forge,anaconda

      - name: Install
        run: |
          source continuous_integration/install_dependencies.sh

      - name: Test
        run: |
          source continuous_integration/test_script.sh

      - name: Upload coverage file
        uses: actions/upload-artifact@v2
        if: ${{env.SINGLE_ACTION_CONFIG == 'True'}}
        with:
          name: coverage
          path: coverage.xml

  build_wheels:
    needs: build

    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-18.04, macos-11, windows-2019 ]
        python-version: [ 3.7, 3.9, "3.10" ]
        include:
          - os: ubuntu-18.04
            python-version: 3.8
          - os: macos-11
            python-version: 3.8
            single_action_config: "True"
          - os: windows-2019
            python-version: 3.8

    env:
      RUNNER_OS: ${{ matrix.os }}
      PYTHON_VERSION: ${{ matrix.python-version }}
      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
      PYPI_USER: ${{ secrets.PYPI_USER }}
      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Set Additional Envs
        shell: bash
        run: |
          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
          echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV

      - name: Build wheels
        if: ${{env.DEPLOY == 'True' && env.USE_OPENMP != 'True'}}
        env:
          CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
          CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
          CIBW_ARCHS_MACOS: x86_64 universal2
        uses: joerick/cibuildwheel@v2.6.1

      - name: Build source
        if: ${{env.DEPLOY == 'True' && env.SINGLE_ACTION_CONFIG == 'True'}}
        run: |
          python setup.py sdist --dist-dir=wheelhouse

      - name: Release to pypi
        if: ${{env.DEPLOY == 'True' &&  env.USE_OPENMP != 'True'}}
        shell: bash
        run: |
          python -m pip install --upgrade twine
          twine check wheelhouse/*
          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD

      - name: Upload artifacts to github
        if: ${{env.DEPLOY == 'True' && env.USE_OPENMP != 'True'}}
        uses: actions/upload-artifact@v1
        with:
          name: wheels
          path: ./wheelhouse

  build_cvxpy-base:
    needs: build

    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-18.04, macos-11, windows-2019 ]
        python-version: [ 3.7, 3.9, "3.10" ]
        include:
          - os: ubuntu-18.04
            python-version: 3.8
            pip_intall: "True"
          - os: macos-11
            python-version: 3.8
            pip_install: "True"
            single_action_config: "True"
          - os: windows-2019
            python-version: 3.8
            pip_install: "True"

    env:
      PYTHON_VERSION: ${{ matrix.python-version }}
      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
      PIP_INSTALL: "${{ matrix.pip_install == 'True' }}"
      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
      PYPI_USER: ${{ secrets.PYPI_USER }}
      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Set Additional Envs
        shell: bash
        run: |
          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
          echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV

      - name: Adapt setup.py
        shell: bash
        run: |
          # Mac has a different syntax for sed -i, this works across oses
          sed -i.bak -e "s/name='cvxpy',/name='cvxpy-base',/g" setup.py
          sed -i.bak '/osqp >= /d' setup.py
          sed -i.bak '/ecos >= /d' setup.py
          sed -i.bak '/scs >= /d' setup.py
          rm -rf setup.py.bak

      - name: Verify that we can build by pip-install on each OS.
        if: ${{env.PIP_INSTALL == 'True'}}
        run: |
          pip install . pytest cplex
          pytest cvxpy/tests/test_conic_solvers.py -k 'TestCPLEX'

      - name: Build wheels
        if: ${{env.DEPLOY == 'True'}}
        env:
          CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
          CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
          CIBW_ARCHS_MACOS: x86_64 universal2
        uses: joerick/cibuildwheel@v2.6.1

      - name: Build source
        if: ${{env.DEPLOY == 'True' && env.SINGLE_ACTION_CONFIG == 'True'}}
        run: |
          python setup.py sdist --dist-dir=wheelhouse

      - name: Release to pypi
        shell: bash
        if: ${{env.DEPLOY == 'True'}}
        run: |
          python -m pip install --upgrade twine
          twine check wheelhouse/*
          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD

      - name: Upload artifacts to github
        if: ${{env.DEPLOY == 'True'}}
        uses: actions/upload-artifact@v1
        with:
          name: wheels-base
          path: ./wheelhouse

  sonarcloud:
    needs: build
    name: SonarCloud
    runs-on: ubuntu-latest
    env:
      SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - uses: actions/download-artifact@v2
        with:
          name: coverage
      - name: Check if environment variable exists
        run: |
          echo "RUN_SONAR=$( [[ -n "$SONAR_TOKEN" ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
      - name: SonarCloud Scan
        if: ${{env.RUN_SONAR == 'True'}}
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
<commit_msg>bump ubuntu runner (#1887)<commit_after>name: build

on:
    pull_request:
    push:
        branches:
            - master
        tags:
          - '*'

jobs:
  cleanup-runs:
    runs-on: ubuntu-latest
    steps:
    - uses: rokroskar/workflow-run-cleanup-action@master
      env:
        GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
    if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

  linters:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: 3.8
      - name: isort
        uses: jamescurtin/isort-action@master
      - name: flake8
        uses: py-actions/flake8@v1

  build:
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        shell: bash -l {0}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-20.04, macos-11, windows-2019 ]
        python-version: [ 3.7, 3.9, "3.10" ]
        include:
          - os: ubuntu-20.04
            python-version: 3.8
            openmp: "True"
          - os: ubuntu-20.04
            python-version: 3.8
          - os: macos-11
            python-version: 3.8
            single_action_config: "True"
          - os: windows-2019
            python-version: 3.8

    env:
      RUNNER_OS: ${{ matrix.os }}
      PYTHON_VERSION: ${{ matrix.python-version }}
      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' && 'True' || 'False' }}"
      USE_OPENMP: "${{ matrix.openmp == 'True' && 'True' || 'False' }}"
      MOSEK_CI_BASE64: ${{ secrets.MOSEK_CI_BASE64 }}

    steps:
      - uses: actions/checkout@v2
      - name: Set Additional Envs
        run: |
          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
          echo $MOSEK_CI_BASE64 | base64 -d > mosek.lic
          echo "MOSEKLM_LICENSE_FILE=$( [[ $RUNNER_OS == 'macOS' ]] && echo $(pwd)/mosek.lic || echo $(realpath mosek.lic) )" >> $GITHUB_ENV
      - uses: conda-incubator/setup-miniconda@v2
        with:
          auto-update-conda: true
          python-version: ${{ matrix.python-version }}
          channels: conda-forge,anaconda

      - name: Install
        run: |
          source continuous_integration/install_dependencies.sh

      - name: Test
        run: |
          source continuous_integration/test_script.sh

      - name: Upload coverage file
        uses: actions/upload-artifact@v2
        if: ${{env.SINGLE_ACTION_CONFIG == 'True'}}
        with:
          name: coverage
          path: coverage.xml

  build_wheels:
    needs: build

    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-20.04, macos-11, windows-2019 ]
        python-version: [ 3.7, 3.9, "3.10" ]
        include:
          - os: ubuntu-20.04
            python-version: 3.8
          - os: macos-11
            python-version: 3.8
            single_action_config: "True"
          - os: windows-2019
            python-version: 3.8

    env:
      RUNNER_OS: ${{ matrix.os }}
      PYTHON_VERSION: ${{ matrix.python-version }}
      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
      PYPI_USER: ${{ secrets.PYPI_USER }}
      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Set Additional Envs
        shell: bash
        run: |
          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
          echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV

      - name: Build wheels
        if: ${{env.DEPLOY == 'True' && env.USE_OPENMP != 'True'}}
        env:
          CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
          CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
          CIBW_ARCHS_MACOS: x86_64 universal2
        uses: joerick/cibuildwheel@v2.6.1

      - name: Build source
        if: ${{env.DEPLOY == 'True' && env.SINGLE_ACTION_CONFIG == 'True'}}
        run: |
          python setup.py sdist --dist-dir=wheelhouse

      - name: Release to pypi
        if: ${{env.DEPLOY == 'True' &&  env.USE_OPENMP != 'True'}}
        shell: bash
        run: |
          python -m pip install --upgrade twine
          twine check wheelhouse/*
          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD

      - name: Upload artifacts to github
        if: ${{env.DEPLOY == 'True' && env.USE_OPENMP != 'True'}}
        uses: actions/upload-artifact@v1
        with:
          name: wheels
          path: ./wheelhouse

  build_cvxpy-base:
    needs: build

    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-20.04, macos-11, windows-2019 ]
        python-version: [ 3.7, 3.9, "3.10" ]
        include:
          - os: ubuntu-20.04
            python-version: 3.8
            pip_intall: "True"
          - os: macos-11
            python-version: 3.8
            pip_install: "True"
            single_action_config: "True"
          - os: windows-2019
            python-version: 3.8
            pip_install: "True"

    env:
      PYTHON_VERSION: ${{ matrix.python-version }}
      SINGLE_ACTION_CONFIG: "${{ matrix.single_action_config == 'True' }}"
      PIP_INSTALL: "${{ matrix.pip_install == 'True' }}"
      PYPI_SERVER: ${{ secrets.PYPI_SERVER }}
      PYPI_USER: ${{ secrets.PYPI_USER }}
      PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}
      - name: Set Additional Envs
        shell: bash
        run: |
          echo "PYTHON_SUBVERSION=$(echo $PYTHON_VERSION | cut -c 3-)" >> $GITHUB_ENV
          echo "DEPLOY=$( [[ $GITHUB_EVENT_NAME == 'push' && $GITHUB_REF == 'refs/tags'* ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV

      - name: Adapt setup.py
        shell: bash
        run: |
          # Mac has a different syntax for sed -i, this works across oses
          sed -i.bak -e "s/name='cvxpy',/name='cvxpy-base',/g" setup.py
          sed -i.bak '/osqp >= /d' setup.py
          sed -i.bak '/ecos >= /d' setup.py
          sed -i.bak '/scs >= /d' setup.py
          rm -rf setup.py.bak

      - name: Verify that we can build by pip-install on each OS.
        if: ${{env.PIP_INSTALL == 'True'}}
        run: |
          pip install . pytest cplex
          pytest cvxpy/tests/test_conic_solvers.py -k 'TestCPLEX'

      - name: Build wheels
        if: ${{env.DEPLOY == 'True'}}
        env:
          CIBW_BUILD: "cp3${{env.PYTHON_SUBVERSION}}-*"
          CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
          CIBW_ARCHS_MACOS: x86_64 universal2
        uses: joerick/cibuildwheel@v2.6.1

      - name: Build source
        if: ${{env.DEPLOY == 'True' && env.SINGLE_ACTION_CONFIG == 'True'}}
        run: |
          python setup.py sdist --dist-dir=wheelhouse

      - name: Release to pypi
        shell: bash
        if: ${{env.DEPLOY == 'True'}}
        run: |
          python -m pip install --upgrade twine
          twine check wheelhouse/*
          twine upload --skip-existing --repository-url $PYPI_SERVER wheelhouse/* -u $PYPI_USER -p $PYPI_PASSWORD

      - name: Upload artifacts to github
        if: ${{env.DEPLOY == 'True'}}
        uses: actions/upload-artifact@v1
        with:
          name: wheels-base
          path: ./wheelhouse

  sonarcloud:
    needs: build
    name: SonarCloud
    runs-on: ubuntu-latest
    env:
      SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0  # Shallow clones should be disabled for a better relevancy of analysis
      - uses: actions/download-artifact@v2
        with:
          name: coverage
      - name: Check if environment variable exists
        run: |
          echo "RUN_SONAR=$( [[ -n "$SONAR_TOKEN" ]] && echo 'True' || echo 'False' )" >> $GITHUB_ENV
      - name: SonarCloud Scan
        if: ${{env.RUN_SONAR == 'True'}}
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

{'fraction_non_alphanumeric': 0.1368321847205042, 'fraction_numerical': 0.019555869706072922, 'mean_word_length': 1.9002391527160916, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1177515', 'n_tokens_mistral': 6055, 'n_tokens_neox': 5680, 'n_words': 1237}