attempt to resolve cpio prereq, update checkout step #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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" | |
branches: | |
- "**" | |
env: | |
relevance: ("Team Demo"; it) of pathnames of (files of it; folders of it) of folders ("/tmp";"/Windows/Temp") | |
jobs: | |
test_run_qna_docker: | |
runs-on: ubuntu-latest | |
container: | |
image: redhat/ubi8:latest | |
steps: | |
- uses: actions/checkout@v4 | |
# https://stackoverflow.com/questions/57946173/github-actions-run-step-on-specific-os | |
- name: install cpio | |
run: sudo 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 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: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
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_debian.sh '${{ env.relevance }}' > qna_output.txt | |
cat qna_output.txt | |
cat qna_output.txt | grep "A: " | sed 's/^.*: //' > qna_markdown.txt | |
echo "## Linux 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 | |
# 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/ |