Home Assistant CI #1738
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Home Assistant CI | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 12 * * * | |
jobs: | |
yamllint: | |
name: Yaml Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get config from GitHub | |
uses: actions/checkout@v4 | |
- name: Run YAMLlint | |
uses: frenck/[email protected] | |
remarklint: | |
name: Remark Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get config from GitHub | |
uses: actions/checkout@v4 | |
- name: Run Remark lint | |
uses: "docker://pipelinecomponents/remark-lint:latest" | |
continue-on-error: true | |
with: | |
args: "remark --no-stdout --color --frail --use preset-lint-recommended ." | |
version_env: | |
name: Get Installed Version for Testing | |
runs-on: ubuntu-latest | |
outputs: | |
current_version: ${{ steps.currentver.outputs.current_version }} | |
steps: | |
- name: Get config from GitHub | |
uses: actions/checkout@v4 | |
- name: Get Installed Version from .HA_VERSION | |
id: currentver | |
run: | | |
HA_VERSION=$(<.HA_VERSION) | |
echo $HA_VERSION | |
echo "{current_version}={$HA_VERSION}" >> $GITHUB_OUTPUT | |
home-assistant: | |
name: "HA ${{ matrix.version }} Config Check" | |
runs-on: ubuntu-latest | |
needs: [yamllint, remarklint, version_env] | |
strategy: | |
matrix: | |
version: ["${{needs.version_env.outputs.current_version}}", "stable", "beta", "dev"] | |
steps: | |
- name: ⤵️ Check out configuration from GitHub | |
uses: actions/checkout@v4 | |
- name: Copy CI service account file | |
run: | | |
cp -R ci_google_service_account.json google_service_account.json | |
- name: 🚀 Run Home Assistant Configuration Check | |
uses: frenck/action-home-assistant@v1 | |
with: | |
path: "." | |
secrets: ci_secrets.yaml | |
version: "${{ matrix.version }}" | |
esphome: | |
runs-on: ubuntu-latest | |
needs: [yamllint] | |
steps: | |
- name: Getting your configuration from GitHub | |
uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
pip install "pillow==10.2.0" | |
pip install esphome | |
pip list | |
esphome version | |
- name: Copy stub files into configuration folder | |
run: | | |
cp -R ci_esphome_common_secrets.yaml esphome/common/secrets.yaml | |
cp -R ci_esphome_secrets.yaml esphome/secrets.yaml | |
- name: Run esphome on all files | |
run: | | |
for file in $(find ./esphome -type f -name "*.yaml" -not -name "secrets.yaml" -maxdepth 1); do esphome config "${file}"; done |