CI #1124
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/[email protected] | |
- name: 🚀 Run yamllint | |
uses: frenck/[email protected] | |
prepare: | |
runs-on: ubuntu-latest | |
needs: | |
- yamllint | |
outputs: | |
files: ${{ steps.files-array.outputs.files }} | |
steps: | |
- name: ⤵️ Check out configuration from GitHub | |
uses: actions/[email protected] | |
- 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 files=$files >> $GITHUB_OUTPUT | |
# 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/[email protected] | |
- name: Set up Python 3.9 | |
uses: actions/[email protected] | |
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 }} |