Skip to content

Commit b781712

Browse files
authored
actions/ci: Add test for test runner (#3140)
Signed-off-by: Ryan Northey <[email protected]>
1 parent 1a91e90 commit b781712

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

.github/workflows/actions.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
runs-on: ubuntu-24.04
1919
outputs:
2020
run: ${{ steps.filter.outputs.run }}
21+
tests: ${{ steps.tests.outputs.output }}
2122
steps:
2223
- uses: envoyproxy/toolshed/gh-actions/github/should-run@c04bdf5c854da00a30144f3597967e73ca376f38
2324
id: filter
@@ -26,8 +27,42 @@ jobs:
2627
paths:
2728
- 'gh-actions/**'
2829
- '.github/workflows/actions.yml'
30+
- id: tests
31+
uses: envoyproxy/toolshed/gh-actions/bson@9bb6f3a6aa6bf95ae2e1c8676dbf7056ff6e7440
32+
with:
33+
input: |
34+
OUTPUT="$(find gh-actions -path "*/tests/*.test.yml" -type f)"
35+
filter: |
36+
bash::output
37+
result-filter: |
38+
split("\n")
39+
| map(select(length > 0))
40+
41+
actions:
42+
runs-on: ubuntu-24.04
43+
needs: should
44+
if: >-
45+
fromJSON(needs.should.outputs.run)
46+
&& needs.should.outputs.tests != '[]'
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
test: ${{ fromJSON(needs.should.outputs.tests) }}
51+
steps:
52+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
53+
- name: Load config
54+
id: config
55+
uses: envoyproxy/toolshed/gh-actions/jq@9bb6f3a6aa6bf95ae2e1c8676dbf7056ff6e7440
56+
with:
57+
input: ${{ matrix.test }}
58+
input-format: yaml-path
59+
- name: Run test
60+
uses: envoyproxy/toolshed/gh-actions/test-runner@9bb6f3a6aa6bf95ae2e1c8676dbf7056ff6e7440
61+
with:
62+
config: ${{ steps.config.outputs.value }}
63+
name: ${{ matrix.test }}
2964

30-
gh-actions:
65+
js-actions:
3166
runs-on: ubuntu-24.04
3267
needs: should
3368
if: fromJSON(needs.should.outputs.run)
@@ -76,7 +111,8 @@ jobs:
76111
name: Actions
77112
needs:
78113
- should
79-
- gh-actions
114+
- actions
115+
- js-actions
80116
steps:
81117
- run: |
82118
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then

0 commit comments

Comments
 (0)