From 6f2ba69e7239f245a7d467f0016d97b4c8415295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Sun, 24 Sep 2023 14:56:50 +0200 Subject: [PATCH] Bump min HA version to 2023.6.0 and python to 3.11 (#3267) * Bump min HA version to 2023.6.0 and python to 3.11 * Use proper version in actions * Build action container in PRs * USe official image * add git * add bash --- .devcontainer.json | 2 +- .github/workflows/action-container.yml | 10 +++++++++- .github/workflows/pytest.yml | 8 ++++---- .github/workflows/validate.yml | 2 +- action/Dockerfile | 4 +++- hacs.json | 2 +- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.devcontainer.json b/.devcontainer.json index 310b582f3ed..0ef4b170d30 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,6 +1,6 @@ { "name": "hacs/integration", - "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye", + "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye", "postCreateCommand": "scripts/setup", "forwardPorts": [ 8123 diff --git a/.github/workflows/action-container.yml b/.github/workflows/action-container.yml index f6894408fa7..b41dde49296 100644 --- a/.github/workflows/action-container.yml +++ b/.github/workflows/action-container.yml @@ -11,6 +11,13 @@ on: - '.github/workflows/action-container.yml' - 'custom_components/**' - 'action/**' + pull_request: + branches: + - main + paths: + - '.github/workflows/action-container.yml' + - 'custom_components/**' + - 'action/**' concurrency: group: container-build-${{ github.ref }} @@ -27,6 +34,7 @@ jobs: - name: Login to GitHub Container Registry uses: docker/login-action@v2.2.0 + if: ${{ github.event_name != 'pull_request' }} with: registry: ghcr.io username: ${{ github.repository_owner }} @@ -47,6 +55,6 @@ jobs: uses: docker/build-push-action@v4.1.1 with: context: ./action - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f033aeb5d6d..49d288a1397 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.9, "3.10", "3.11"] + python-version: ["3.11"] steps: - name: 📥 Checkout the repository uses: actions/checkout@v3.5.3 @@ -27,7 +27,7 @@ jobs: uses: actions/setup-python@v4.7.0 id: python with: - python-version: "3.x" + python-version: ${{ matrix.python-version }} cache: 'pip' cache-dependency-path: | requirements_base.txt @@ -51,7 +51,7 @@ jobs: curl -sfSL https://codecov.io/bash | bash - legacy: - name: With pytest with Home Assistant 2022.11.0 + name: With pytest with Home Assistant 2023.6.0 runs-on: ubuntu-latest steps: - name: 📥 Checkout the repository @@ -60,7 +60,7 @@ jobs: - name: 🛠️ Set up Python 3.9 uses: actions/setup-python@v4.7.0 with: - python-version: "3.9" + python-version: "3.11" cache: 'pip' cache-dependency-path: | requirements_base.txt diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index bc5a0fa190a..7755a5dd3cf 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -88,7 +88,7 @@ jobs: name: With Home Assistant strategy: matrix: - channel: [stable, beta, dev, "2022.11.0"] + channel: [stable, beta, dev, "2023.6.0"] runs-on: ubuntu-latest steps: - name: 📥 Checkout the repository diff --git a/action/Dockerfile b/action/Dockerfile index f1917000d49..6b4e40d14f7 100644 --- a/action/Dockerfile +++ b/action/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/ludeeus/alpine/python:3.10 +FROM python:3.11-alpine WORKDIR /hacs @@ -7,7 +7,9 @@ RUN \ libffi-dev \ \ && apk add --no-cache --virtual .build-deps \ + bash \ gcc \ + git \ musl-dev \ \ && git clone --quiet --depth 1 https://github.com/hacs/integration.git /hacs \ diff --git a/hacs.json b/hacs.json index ff25bde4205..64cb15f9fe5 100644 --- a/hacs.json +++ b/hacs.json @@ -2,7 +2,7 @@ "name": "HACS", "zip_release": true, "hide_default_branch": true, - "homeassistant": "2022.11.0", + "homeassistant": "2023.6.0", "hacs": "0.19.0", "filename": "hacs.zip" } \ No newline at end of file