generated from actions/hello-world-docker-action
-
Notifications
You must be signed in to change notification settings - Fork 7
180 lines (176 loc) · 5.95 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
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
name: CI
on:
pull_request:
types: [opened, synchronize]
paths-ignore:
- 'docs/**'
- '**.md'
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '**.md'
workflow_dispatch:
jobs:
single-job-test:
name: Test single job
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v4
with:
path: .github/actions/gha-jobid-action
- name: Run action with options
id: test1
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (1)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225949607"
- name: Verify
run: |
check_url() {
if [[ "$1" == "$2" ]]; then
echo "html_url OK"
else
echo "html_url ERROR" >&2
ERROR_FLAG=1
fi
}
check_job_id() {
if [[ "$1" == "$2" ]]; then
echo "job_id OK"
else
echo "job_id ERROR" >&2
ERROR_FLAG=1
fi
}
ERROR_FLAG=0
check_url "${{ steps.test1.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225949607/job/16897423007"
check_job_id "${{ steps.test1.outputs.job_id }}" "16897423007"
if [[ "$ERROR_FLAG" == 1 ]]; then
exit 1
fi
multi-jobs-test:
name: Test multi jobs
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v4
with:
path: .github/actions/gha-jobid-action
- name: Run action with options
id: test1
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (1)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225954167"
- name: Run action with options
id: test2
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (2)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225954167"
- name: Run action with options
id: test3
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (3)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225954167"
- name: Verify
run: |
check_url() {
if [[ "$1" == "$2" ]]; then
echo "html_url OK"
else
echo "html_url ERROR" >&2
ERROR_FLAG=1
fi
}
check_job_id() {
if [[ "$1" == "$2" ]]; then
echo "job_id OK"
else
echo "job_id ERROR" >&2
ERROR_FLAG=1
fi
}
ERROR_FLAG=0
check_url "${{ steps.test1.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225954167/job/16897439433"
check_job_id "${{ steps.test1.outputs.job_id }}" "16897439433"
check_url "${{ steps.test2.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225954167/job/16897439692"
check_job_id "${{ steps.test2.outputs.job_id }}" "16897439692"
check_url "${{ steps.test3.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225954167/job/16897439920"
check_job_id "${{ steps.test3.outputs.job_id }}" "16897439920"
if [[ "$ERROR_FLAG" == 1 ]]; then
exit 1
fi
multi-jobs-test-31:
name: Test multi jobs more than 30
runs-on: ubuntu-latest
steps:
- name: Checkout action
uses: actions/checkout@v4
with:
path: .github/actions/gha-jobid-action
- name: Run action with options
id: test1
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (1)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225955888"
- name: Run action with options
id: test2
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (2)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225955888"
- name: Run action with options
id: test3
uses: ./.github/actions/gha-jobid-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
job_name: "build-matrix (31)"
repository: "Tiryoh/gha-jobid-action"
run_id: "6225955888"
per_page: 100
- name: Verify
run: |
check_url() {
if [[ "$1" == "$2" ]]; then
echo "html_url OK"
else
echo "html_url ERROR" >&2
ERROR_FLAG=1
fi
}
check_job_id() {
if [[ "$1" == "$2" ]]; then
echo "job_id OK"
else
echo "job_id ERROR" >&2
ERROR_FLAG=1
fi
}
ERROR_FLAG=0
check_url "${{ steps.test1.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225955888/job/16897445873"
check_job_id "${{ steps.test1.outputs.job_id }}" "16897445873"
check_url "${{ steps.test2.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225955888/job/16897446063"
check_job_id "${{ steps.test2.outputs.job_id }}" "16897446063"
check_url "${{ steps.test3.outputs.html_url }}" "https://github.com/Tiryoh/gha-jobid-action/actions/runs/6225955888/job/16897453514"
check_job_id "${{ steps.test3.outputs.job_id }}" "16897453514"
if [[ "$ERROR_FLAG" == 1 ]]; then
exit 1
fi