<commit_before>name: Build wheels

# yamllint disable-line rule:truthy
on:
  workflow_dispatch:
  schedule:
    - cron: "0 4 * * *"
  push:
    branches:
      - dev
      - rc
    paths:
      - "requirements.txt"
      - "requirements_all.txt"

jobs:
  init:
    name: Initialize wheels builder
    if: github.repository_owner == 'home-assistant'
    runs-on: ubuntu-latest
    outputs:
      architectures: ${{ steps.info.outputs.architectures }}
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v3.0.2

      - name: Get information
        id: info
        uses: home-assistant/actions/helpers/info@master

      - name: Create requirements_diff file
        run: |
          if [[ ${{ github.event_name }} =~ (schedule|workflow_dispatch) ]]; then
            touch requirements_diff.txt
          else
            curl -s -o requirements_diff.txt https://raw.githubusercontent.com/home-assistant/core/master/requirements.txt
          fi

      - name: Write env-file
        run: |
          (
            echo "GRPC_BUILD_WITH_BORING_SSL_ASM=false"
            echo "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true"
            echo "GRPC_PYTHON_BUILD_WITH_CYTHON=true"
            echo "GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=true"
            # GRPC on armv7 needs -lexecinfo (issue #56669) since home assistant installs
            # execinfo-dev when building wheels. The setuptools build setup does not have an option for
            # adding a single LDFLAG so copy all relevant linux flags here (as of 1.43.0)
            echo "GRPC_PYTHON_LDFLAGS=-lpthread -Wl,-wrap,memcpy -static-libgcc -lexecinfo"
          ) > .env_file

      - name: Upload env_file
        uses: actions/upload-artifact@v3.0.0
        with:
          name: env_file
          path: ./.env_file

      - name: Upload requirements_diff
        uses: actions/upload-artifact@v3.0.0
        with:
          name: requirements_diff
          path: ./requirements_diff.txt

  core:
    name: Build wheels with ${{ matrix.tag }} (${{ matrix.arch }}) for core
    if: github.repository_owner == 'home-assistant'
    needs: init
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        arch: ${{ fromJson(needs.init.outputs.architectures) }}
        tag:
          - "3.9-alpine3.14"
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v3.0.2

      - name: Download env_file
        uses: actions/download-artifact@v3
        with:
          name: env_file

      - name: Download requirements_diff
        uses: actions/download-artifact@v3
        with:
          name: requirements_diff

      - name: Build wheels
        uses: home-assistant/wheels@2022.01.2
        with:
          tag: ${{ matrix.tag }}
          arch: ${{ matrix.arch }}
          wheels-host: wheels.hass.io
          wheels-key: ${{ secrets.WHEELS_KEY }}
          wheels-user: wheels
          env-file: true
          apk: "build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;cargo"
          pip: "Cython;numpy"
          skip-binary: aiohttp
          constraints: "homeassistant/package_constraints.txt"
          requirements-diff: "requirements_diff.txt"
          requirements: "requirements.txt"

  integrations:
    name: Build wheels with ${{ matrix.tag }} (${{ matrix.arch }}) for integrations
    if: github.repository_owner == 'home-assistant'
    needs: init
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        arch: ${{ fromJson(needs.init.outputs.architectures) }}
        tag:
          - "3.9-alpine3.14"
    steps:<commit_msg>Freeze numpy on wheel build (#71408)<commit_after>name: Build wheels

# yamllint disable-line rule:truthy
on:
  workflow_dispatch:
  schedule:
    - cron: "0 4 * * *"
  push:
    branches:
      - dev
      - rc
    paths:
      - "requirements.txt"
      - "requirements_all.txt"

jobs:
  init:
    name: Initialize wheels builder
    if: github.repository_owner == 'home-assistant'
    runs-on: ubuntu-latest
    outputs:
      architectures: ${{ steps.info.outputs.architectures }}
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v3.0.2

      - name: Get information
        id: info
        uses: home-assistant/actions/helpers/info@master

      - name: Create requirements_diff file
        run: |
          if [[ ${{ github.event_name }} =~ (schedule|workflow_dispatch) ]]; then
            touch requirements_diff.txt
          else
            curl -s -o requirements_diff.txt https://raw.githubusercontent.com/home-assistant/core/master/requirements.txt
          fi

      - name: Write env-file
        run: |
          (
            echo "GRPC_BUILD_WITH_BORING_SSL_ASM=false"
            echo "GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=true"
            echo "GRPC_PYTHON_BUILD_WITH_CYTHON=true"
            echo "GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=true"
            # GRPC on armv7 needs -lexecinfo (issue #56669) since home assistant installs
            # execinfo-dev when building wheels. The setuptools build setup does not have an option for
            # adding a single LDFLAG so copy all relevant linux flags here (as of 1.43.0)
            echo "GRPC_PYTHON_LDFLAGS=-lpthread -Wl,-wrap,memcpy -static-libgcc -lexecinfo"
          ) > .env_file

      - name: Upload env_file
        uses: actions/upload-artifact@v3.0.0
        with:
          name: env_file
          path: ./.env_file

      - name: Upload requirements_diff
        uses: actions/upload-artifact@v3.0.0
        with:
          name: requirements_diff
          path: ./requirements_diff.txt

  core:
    name: Build wheels with ${{ matrix.tag }} (${{ matrix.arch }}) for core
    if: github.repository_owner == 'home-assistant'
    needs: init
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        arch: ${{ fromJson(needs.init.outputs.architectures) }}
        tag:
          - "3.9-alpine3.14"
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v3.0.2

      - name: Download env_file
        uses: actions/download-artifact@v3
        with:
          name: env_file

      - name: Download requirements_diff
        uses: actions/download-artifact@v3
        with:
          name: requirements_diff

      - name: Build wheels
        uses: home-assistant/wheels@2022.01.2
        with:
          tag: ${{ matrix.tag }}
          arch: ${{ matrix.arch }}
          wheels-host: wheels.hass.io
          wheels-key: ${{ secrets.WHEELS_KEY }}
          wheels-user: wheels
          env-file: true
          apk: "build-base;cmake;git;linux-headers;bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;cargo"
          pip: "Cython;numpy==1.21.6"
          skip-binary: aiohttp
          constraints: "homeassistant/package_constraints.txt"
          requirements-diff: "requirements_diff.txt"
          requirements: "requirements.txt"

  integrations:
    name: Build wheels with ${{ matrix.tag }} (${{ matrix.arch }}) for integrations
    if: github.repository_owner == 'home-assistant'
    needs: init
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        arch: ${{ fromJson(needs.init.outputs.architectures) }}
        tag:
          - "3.9-alpine3.14"
    steps:
{'fraction_non_alphanumeric': 0.10469998645537044, 'fraction_numerical': 0.013138290667750237, 'mean_word_length': 2.105130361648444, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '896862', 'n_tokens_mistral': 2387, 'n_tokens_neox': 2294, 'n_words': 492}