From 2adda3a9949a7f1a04512bf57d10ad4a8a6b3c24 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Fri, 27 Oct 2023 14:59:10 +1300 Subject: [PATCH] Validate test files before compiling (#5611) * Validate test files before compiling * Dont restrict parallel --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70da22e57..8d1daf922 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -221,6 +221,29 @@ jobs: id: set-matrix run: echo "matrix=$(ls tests/test*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + validate-tests: + name: Validate YAML test ${{ matrix.file }} + runs-on: ubuntu-latest + needs: + - common + - compile-tests-list + strategy: + fail-fast: false + matrix: + file: ${{ fromJson(needs.compile-tests-list.outputs.matrix) }} + steps: + - name: Check out code from GitHub + uses: actions/checkout@v4.1.1 + - name: Restore Python + uses: ./.github/actions/restore-python + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache-key: ${{ needs.common.outputs.cache-key }} + - name: Run esphome config ${{ matrix.file }} + run: | + . venv/bin/activate + esphome config ${{ matrix.file }} + compile-tests: name: Run YAML test ${{ matrix.file }} runs-on: ubuntu-latest @@ -234,6 +257,7 @@ jobs: - pytest - pyupgrade - compile-tests-list + - validate-tests strategy: fail-fast: false max-parallel: 2