-
Notifications
You must be signed in to change notification settings - Fork 12
45 lines (40 loc) · 1.27 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
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 }}