-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (72 loc) · 2.04 KB
/
Copy pathtest.yml
File metadata and controls
78 lines (72 loc) · 2.04 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Run Tests
on:
push:
branches:
- "**"
tags-ignore:
- "**"
# Can't run on pull_request because the token won't have actions:write permission
workflow_dispatch:
permissions:
actions: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Normal case
expected_to_fail: false
ref: ${{ github.ref_name }}
inputs: |
{
"sleep": "10",
"fail": "false"
}
run_timeout_seconds: 300
- name: ref instead of ref_name
expected_to_fail: false
ref: ${{ github.ref }}
inputs: |
{
"sleep": "10",
"fail": "false"
}
run_timeout_seconds: 300
- name: Failed workflow
expected_to_fail: true
ref: ${{ github.ref_name }}
inputs: |
{
"sleep": "10",
"fail": "true"
}
run_timeout_seconds: 300
- name: Run succeeds but takes too long
expected_to_fail: true
ref: ${{ github.ref_name }}
inputs: |
{
"sleep": "20",
"fail": "false"
}
run_timeout_seconds: 10
name: ${{ matrix.name }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Dispatch dummy workflow
id: dispatch_dummy_workflow
continue-on-error: ${{ matrix.expected_to_fail }}
uses: ./
with:
token: ${{ github.token }}
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
ref: ${{ matrix.ref }}
workflow: dummy.yml
workflow_inputs: ${{ matrix.inputs }}
run_timeout_seconds: ${{ matrix.run_timeout_seconds }}
- name: Assert dummy workflow failed
if: ${{ matrix.expected_to_fail && steps.dispatch_dummy_workflow.outcome != 'failure' }}
run: exit 1