mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Ci find YAML tests dynamically (#5399)
* Find all YAML test files dynamically. * Merge error * GitHub set-ouput syntax upgrade. --------- Co-authored-by: Your Name <you@example.com>
This commit is contained in:
		
							
								
								
									
										18
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							| @@ -210,6 +210,17 @@ jobs: | |||||||
|         run: script/ci-suggest-changes |         run: script/ci-suggest-changes | ||||||
|         if: always() |         if: always() | ||||||
|  |  | ||||||
|  |   compile-tests-list: | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     outputs: | ||||||
|  |       matrix: ${{ steps.set-matrix.outputs.matrix }} | ||||||
|  |     steps: | ||||||
|  |       - name: Check out code from GitHub | ||||||
|  |         uses: actions/checkout@v4.0.0 | ||||||
|  |       - name: Find all YAML test files | ||||||
|  |         id: set-matrix | ||||||
|  |         run: echo "matrix=$(ls tests/test*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT | ||||||
|  |  | ||||||
|   compile-tests: |   compile-tests: | ||||||
|     name: Run YAML test ${{ matrix.file }} |     name: Run YAML test ${{ matrix.file }} | ||||||
|     runs-on: ubuntu-latest |     runs-on: ubuntu-latest | ||||||
| @@ -222,11 +233,12 @@ jobs: | |||||||
|       - pylint |       - pylint | ||||||
|       - pytest |       - pytest | ||||||
|       - pyupgrade |       - pyupgrade | ||||||
|  |       - compile-tests-list | ||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       max-parallel: 2 |       max-parallel: 2 | ||||||
|       matrix: |       matrix: | ||||||
|         file: [1, 2, 3, 3.1, 4, 5, 6, 7, 8, 10, 11.5] |         file: ${{ fromJson(needs.compile-tests-list.outputs.matrix) }} | ||||||
|     steps: |     steps: | ||||||
|       - name: Check out code from GitHub |       - name: Check out code from GitHub | ||||||
|         uses: actions/checkout@v4.0.0 |         uses: actions/checkout@v4.0.0 | ||||||
| @@ -235,10 +247,10 @@ jobs: | |||||||
|         with: |         with: | ||||||
|           python-version: ${{ env.DEFAULT_PYTHON }} |           python-version: ${{ env.DEFAULT_PYTHON }} | ||||||
|           cache-key: ${{ needs.common.outputs.cache-key }} |           cache-key: ${{ needs.common.outputs.cache-key }} | ||||||
|       - name: Run esphome compile tests/test${{ matrix.file }}.yaml |       - name: Run esphome compile ${{ matrix.file }} | ||||||
|         run: | |         run: | | ||||||
|           . venv/bin/activate |           . venv/bin/activate | ||||||
|           esphome compile tests/test${{ matrix.file }}.yaml |           esphome compile ${{ matrix.file }} | ||||||
|  |  | ||||||
|   clang-tidy: |   clang-tidy: | ||||||
|     name: ${{ matrix.name }} |     name: ${{ matrix.name }} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user