-
Notifications
You must be signed in to change notification settings - Fork 15
213 lines (201 loc) · 10.3 KB
/
test_run_qna.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
---
name: test_run_qna
on:
push:
paths:
- ".github/workflows/test_run_qna.yaml"
- "CMD/bigfix_run_qna_win.bat"
- "bash/bigfix_run_qna_debian.sh"
- "bash/bigfix_run_qna_macos.sh"
- "bash/bigfix_run_qna_rhel_family.sh"
- "bash/bigfix_run_qna_ubuntu.sh"
branches:
- "**"
env:
relevance: ( (it as string) of operating system ; (it as string) of version of client ; elements of it ) of sets of pathnames of (files of it; folders of it) of folders ("/tmp";"/Windows/Temp")
# TODO: add OSes: Raspbian, Amazon Linux, SUSE Linux Enterprise, OpenSUSE Leap
# https://github.com/pguyot/arm-runner-action
jobs:
test_run_qna:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
[
macos-latest,
windows-latest,
windows-2019,
ubuntu-24.04,
ubuntu-22.04,
ubuntu-20.04,
]
steps:
- uses: actions/checkout@v4
# https://stackoverflow.com/questions/57946173/github-actions-run-step-on-specific-os
- name: run qna linux
if: runner.os == 'Linux'
# https://github.com/jgstew/tools/blob/master/bash/bigfix_run_qna_debian.sh
run: |
bash bash/bigfix_run_qna_ubuntu.sh '${{ env.relevance }}' > qna_output.txt
cat qna_output.txt
cat qna_output.txt | grep "A: " | sed 's/^.*: //' > qna_markdown.txt
echo "## Linux Ubuntu QNA:" >> $GITHUB_STEP_SUMMARY
echo "### Errors:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "E: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Result Type:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "I: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Time Taken:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "T: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Answers:" >> $GITHUB_STEP_SUMMARY
echo 'Q: `${{ env.relevance }}`' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat qna_markdown.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: run qna mac
if: runner.os == 'macOS'
# https://github.com/jgstew/tools/blob/master/bash/bigfix_run_qna_macos.sh
run: |
bash bash/bigfix_run_qna_macos.sh '${{ env.relevance }}' > qna_output.txt
cat qna_output.txt
cat qna_output.txt | grep "A: " | sed 's/^.*: //' > qna_markdown.txt
echo "## MacOS QNA:" >> $GITHUB_STEP_SUMMARY
echo "### Errors:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "E: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Result Type:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "I: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Time Taken:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "T: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Answers:" >> $GITHUB_STEP_SUMMARY
echo 'Q: `${{ env.relevance }}`' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat qna_markdown.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: run qna windows
if: runner.os == 'Windows'
# https://github.com/jgstew/tools/blob/master/CMD/bigfix_run_qna_win.bat
run: |
echo '${{ env.relevance }}' | CMD /C CMD\bigfix_run_qna_win.bat > qna_output.txt
cat qna_output.txt
cat qna_output.txt | Select-String -Pattern "A: (.+)" | % { $_.Matches } | % { "" + $_.Groups[1].Value } > qna_markdown.txt
echo "## Windows QNA:" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo "### Errors:" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
cat qna_output.txt | Select-String -Pattern "E: (.+)" | % { $_.Matches } | % { "" + $_.Groups[1].Value } | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo "### Result Type:" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
cat qna_output.txt | Select-String -Pattern "I: (.+)" | % { $_.Matches } | % { "" + $_.Groups[1].Value } | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo "### Time Taken:" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
cat qna_output.txt | Select-String -Pattern "T: (.+)" | % { $_.Matches } | % { "" + $_.Groups[1].Value } | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo "### Answers:" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo 'Q: ``${{ env.relevance }}``' | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo "``````" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
cat qna_markdown.txt | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
echo "``````" | Out-File -FilePath $Env:GITHUB_STEP_SUMMARY -Encoding utf8 -Append
test_run_qna_docker_rhel_family:
runs-on: ubuntu-latest
strategy:
matrix:
container-image:
[
"redhat/ubi8:latest",
"redhat/ubi9:latest",
"almalinux:latest",
"oraclelinux:9",
"rockylinux:9",
]
container:
image: ${{ matrix.container-image }}
steps:
- uses: actions/checkout@v4
# https://stackoverflow.com/questions/57946173/github-actions-run-step-on-specific-os
- name: install cpio
run: dnf --assumeyes install cpio
- name: run qna linux rhel
if: runner.os == 'Linux'
# https://github.com/jgstew/tools/blob/master/bash/bigfix_run_qna_debian.sh
run: |
bash bash/bigfix_run_qna_rhel_family.sh '${{ env.relevance }}' > qna_output.txt
cat qna_output.txt
cat qna_output.txt | grep "A: " | sed 's/^.*: //' > qna_markdown.txt
echo "## Linux RHEL Family QNA:" >> $GITHUB_STEP_SUMMARY
echo "### Errors:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "E: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Result Type:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "I: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Time Taken:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "T: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Answers:" >> $GITHUB_STEP_SUMMARY
echo 'Q: `${{ env.relevance }}`' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat qna_markdown.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
test_run_qna_docker_debian:
runs-on: ubuntu-latest
strategy:
matrix:
container-image: ["debian:latest", "debian:11"]
container:
image: ${{ matrix.container-image }}
steps:
- uses: actions/checkout@v4
- name: install prereqs
run: |
apt-get -y update
apt-get install -y curl binutils
# https://stackoverflow.com/questions/57946173/github-actions-run-step-on-specific-os
- name: run qna linux debian
if: runner.os == 'Linux'
# https://github.com/jgstew/tools/blob/master/bash/bigfix_run_qna_debian.sh
run: |
bash bash/bigfix_run_qna_debian.sh '${{ env.relevance }}' > qna_output.txt
cat qna_output.txt
cat qna_output.txt | grep "A: " | sed 's/^.*: //' > qna_markdown.txt
echo "## Linux Debian QNA:" >> $GITHUB_STEP_SUMMARY
echo "### Errors:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "E: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Result Type:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "I: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Time Taken:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "T: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Answers:" >> $GITHUB_STEP_SUMMARY
echo 'Q: `${{ env.relevance }}`' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat qna_markdown.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
test_run_qna_docker_suse_family:
runs-on: ubuntu-latest
strategy:
matrix:
container-image: ["opensuse/tumbleweed:latest"]
container:
image: ${{ matrix.container-image }}
steps:
- name: install prereqs
# https://software.opensuse.org/download.html?project=Base%3ASystem&package=tar
run: |
zypper -n --gpg-auto-import-keys addrepo -y https://download.opensuse.org/repositories/Base:System/openSUSE_Tumbleweed/Base:System.repo
zypper install -y tar
- uses: actions/checkout@v4
# https://stackoverflow.com/questions/57946173/github-actions-run-step-on-specific-os
- name: run qna linux suse
if: runner.os == 'Linux'
# https://github.com/jgstew/tools/blob/master/bash/bigfix_run_qna_debian.sh
run: |
bash bash/bigfix_run_qna_suse_family.sh '${{ env.relevance }}' > qna_output.txt
cat qna_output.txt
cat qna_output.txt | grep "A: " | sed 's/^.*: //' > qna_markdown.txt
echo "## Linux SUSE QNA:" >> $GITHUB_STEP_SUMMARY
echo "### Errors:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "E: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Result Type:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "I: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Time Taken:" >> $GITHUB_STEP_SUMMARY
cat qna_output.txt | grep "T: " | sed 's/^.*: //' >> $GITHUB_STEP_SUMMARY
echo "### Answers:" >> $GITHUB_STEP_SUMMARY
echo 'Q: `${{ env.relevance }}`' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat qna_markdown.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
# References:
# - https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary
# - https://stackoverflow.com/questions/61326842/powershell-how-to-capture-a-string-of-text-after-a-certain-pattern-but-without-i
# - https://stackoverflow.com/questions/10358547/how-to-grep-for-contents-after-pattern
# - https://www.jamescroft.co.uk/setting-github-actions-environment-variables-in-powershell/