CI #956
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: CI | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
schedule: | |
- cron: 0 10 * * * | |
concurrency: | |
# yamllint disable-line rule:line-length | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
yamllint: | |
name: 🧹 yamllint | |
runs-on: ubuntu-latest | |
steps: | |
- name: ⤵️ Check out configuration from GitHub | |
uses: actions/checkout@v4.1.4 | |
- name: 🚀 Run yamllint | |
uses: frenck/action-yamllint@v1.5.0 | |
prepare: | |
runs-on: ubuntu-latest | |
needs: | |
- yamllint | |
outputs: | |
files: ${{ steps.files-array.outputs.files }} | |
steps: | |
- name: ⤵️ Check out configuration from GitHub | |
uses: actions/checkout@v4.1.4 | |
- name: Build files array | |
id: files-array | |
# yamllint disable rule:line-length | |
run: |- | |
files=$(find . -maxdepth 1 -type f -name "*.yaml" -not -name "secrets.yaml" -not -name "secrets.ci.yaml" | jq -Rcns 'inputs | . / "\n" | map(select(length > 0) | sub("./";"")) ') | |
echo ::set-output name=files::$files | |
# yamllint enable rule:line-length | |
configs: | |
runs-on: ubuntu-latest | |
name: "Validate ESPHome config: ${{ matrix.file }}" | |
needs: | |
- yamllint | |
- prepare | |
strategy: | |
matrix: | |
file: ${{ fromJson(needs.prepare.outputs.files) }} | |
fail-fast: false | |
steps: | |
- name: ⤵️ Check out configuration from GitHub | |
uses: actions/checkout@v4.1.4 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5.1.0 | |
with: | |
python-version: 3.9 | |
- name: Install ESPHome | |
run: pip install git+https://github.com/esphome/esphome.git@dev | |
- name: Rename stub secrets | |
run: mv ./secrets.ci.yaml ./secrets.yaml | |
- name: Install extra requirements | |
run: |- | |
if [ -f .github/workflows/requirements/${{matrix.file}}.txt ]; then | |
pip install -r .github/workflows/requirements/${{matrix.file}}.txt | |
fi | |
- name: Run ESPHome config | |
run: esphome config ${{ matrix.file }} |