This repository was archived by the owner on Mar 17, 2025. It is now read-only.
Examples using compose #159
This file contains hidden or 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: Test Examples | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
get-examples-with-changes: | |
runs-on: ubuntu-latest | |
outputs: | |
changed_directories: ${{ steps.set-output.outputs.changed_directories }} # The `dirs` doesn't exist in the outputs of changed-files@v35 action. | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v45.0.3 | |
with: | |
# only get the top level example dirs that have changes | |
dir_names: true | |
dir_names_max_depth: 1 | |
dir_names_exclude_current_dir: true | |
exclude_submodules: true | |
files_ignore: | | |
*.md | |
.github/**/* | |
json: true | |
quotepath: false | |
- name: 'Set output in the matrix format' | |
id: set-output | |
run: echo "changed_directories={\"dir\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT" | |
testing: | |
if: ${{ needs.get-examples-with-changes.outputs.changed_directories != '' }} | |
strategy: | |
matrix: ${{fromJson(needs.get-examples-with-changes.outputs.changed_directories)}} | |
fail-fast: false | |
needs: | |
- get-examples-with-changes | |
uses: ./.github/workflows/reusable_test_runner.yaml | |
with: | |
example-dir: ${{ matrix.dir }} |