Skip to content

Commit a19a2ab

Browse files
committed
Automate building wheels for common build dependencies
1 parent 92aa2f7 commit a19a2ab

File tree

6 files changed

+104
-1
lines changed

6 files changed

+104
-1
lines changed

.github/dependabot.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
version: 2
22
updates:
3+
- package-ecosystem: pip
4+
directory: "/.github/workflows/wheel_build"
5+
schedule:
6+
interval: daily
7+
time: "03:00"
8+
commit-message:
9+
prefix: "[wheel] "
10+
open-pull-requests-limit: 10
311
- package-ecosystem: "github-actions"
412
directory: "/"
513
schedule:

.github/workflows/ci.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ on:
88
- dev
99
- rc
1010
- master
11-
pull_request: ~
11+
pull_request:
12+
paths-ignore:
13+
- ".github/workflows/wheel_build/requirements_wheels.txt"
1214
workflow_dispatch:
1315
inputs:
1416
full:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Only add build system requirements here or or dependencies
2+
# which should be build for each new release here!
3+
# The versions are updated with dependabot daily.
4+
5+
# Anything else should be build as part of the regular
6+
# requirements wheel build.
7+
8+
cffi==1.17.1
9+
cython==3.0.11
10+
mysqlclient==2.2.6
11+
ninja==1.11.1.1
12+
numpy==2.1.3
13+
psycopg2==2.9.10

.github/workflows/wheels-common.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Build common wheels
2+
3+
# yamllint disable-line rule:truthy
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: "0 2 * * *" # every day at 02:00
8+
pull_request:
9+
branches:
10+
- dev
11+
paths:
12+
- ".github/workflows/wheels-common.yml"
13+
- ".github/workflows/wheel_build/requirements_wheels.txt"
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref_name}}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
init:
21+
name: Initialize wheels builder
22+
if: github.repository_owner == 'home-assistant'
23+
runs-on: ubuntu-latest
24+
outputs:
25+
architectures: ${{ steps.info.outputs.architectures }}
26+
steps:
27+
- name: Checkout the repository
28+
uses: actions/[email protected]
29+
30+
- name: Get information
31+
id: info
32+
uses: home-assistant/actions/helpers/info@master
33+
34+
- name: Write env-file
35+
run: |
36+
(
37+
# Fix out of memory issues with rust
38+
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true"
39+
) > .env_file
40+
41+
- name: Upload env_file
42+
uses: actions/[email protected]
43+
with:
44+
name: env_file
45+
path: ./.env_file
46+
include-hidden-files: true
47+
overwrite: true
48+
49+
wheels:
50+
name: Build common wheels
51+
if: github.repository_owner == 'home-assistant'
52+
needs: init
53+
runs-on: ubuntu-latest
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
abi: ["cp312", "cp313"]
58+
arch: ${{ fromJson(needs.init.outputs.architectures) }}
59+
steps:
60+
- name: Check out code from GitHub
61+
uses: actions/[email protected]
62+
63+
- name: Download env_file
64+
uses: actions/[email protected]
65+
with:
66+
name: env_file
67+
68+
- name: Build wheels
69+
uses: home-assistant/[email protected]
70+
with:
71+
abi: ${{ matrix.abi }}
72+
tag: musllinux_1_2
73+
arch: ${{ matrix.arch }}
74+
wheels-key: ${{ secrets.WHEELS_KEY }}
75+
env-file: true
76+
apk: "mariadb-dev;postgresql-dev;libffi-dev;openblas-dev"
77+
skip-binary: "cython"
78+
requirements: ".github/workflows/wheel_build/requirements_wheel.txt"

CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ pyproject.toml @home-assistant/core
1717
requirements_test.txt @home-assistant/core
1818
/.devcontainer/ @home-assistant/core
1919
/.github/ @home-assistant/core
20+
/.github/workflows/wheel_build/requirements_wheel.txt @home-assistant/core @cdce8p
2021
/.vscode/ @home-assistant/core
2122
/homeassistant/*.py @home-assistant/core
2223
/homeassistant/auth/ @home-assistant/core

script/hassfest/codeowners.py

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
requirements_test.txt @home-assistant/core
2525
/.devcontainer/ @home-assistant/core
2626
/.github/ @home-assistant/core
27+
/.github/workflows/wheel_build/requirements_wheel.txt @home-assistant/core @cdce8p
2728
/.vscode/ @home-assistant/core
2829
/homeassistant/*.py @home-assistant/core
2930
/homeassistant/auth/ @home-assistant/core

0 commit comments

Comments
 (0)