Skip to content

Add support for multiple phases in HomeAssistant #92

Add support for multiple phases in HomeAssistant

Add support for multiple phases in HomeAssistant #92

Workflow file for this run

name: CI Pipeline
on:
push:
branches: [ main ]
tags: [ "*.*.*" ]
pull_request:
branches: [ main ]
permissions:
packages: write
contents: read
jobs:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install pipenv
pipenv install --dev
- name: Run tests
run: pipenv run python3 -m pytest --junitxml=test-results.xml
- name: Validate Python code with flake8
run: pipenv run python3 -m flake8 --select BLK **/*.py
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.python-version }}
path: test-results.xml
build:
strategy:
fail-fast: false
matrix:
config:
- platform: linux/amd64
base: distroless
- platform: linux/arm/v6
base: alpine
- platform: linux/arm/v7
base: alpine
- platform: linux/arm64
base: distroless
uses: ./.github/workflows/build-image.yml
with:
registry: ghcr.io
platform: ${{ matrix.config.platform }}
base: ${{ matrix.config.base }}
context: .
dockerfile: ./Dockerfile
image-suffix: ""
digest-prefix: ""
merge:
needs: [build]
uses: ./.github/workflows/merge-manifests.yml
with:
registry: ghcr.io
image-suffix: ""
digest-prefix: ""
build-addon:
strategy:
fail-fast: false
matrix:
platform:
- linux/amd64
- linux/arm64
- linux/arm/v7
- linux/arm/v6
uses: ./.github/workflows/build-image.yml
with:
registry: ghcr.io
platform: ${{ matrix.platform }}
context: ./ha_addon
dockerfile: ha_addon/Dockerfile
build-args: |
BUILD_FROM=ghcr.io/hassio-addons/base:14.2.2
image-suffix: "-addon"
digest-prefix: "addon-"
merge-addon:
needs: [build-addon]
uses: ./.github/workflows/merge-manifests.yml
with:
registry: ghcr.io
image-suffix: "-addon"
digest-prefix: "addon-"