feat: add code lint “shellcheck” to github actions and configured cod… #18
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: Check A+B Result | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
A_plus_B: | |
runs-on: | |
ubuntu-latest | |
steps: | |
- name: | |
Checkout code | |
uses: | |
actions/checkout@v3 | |
- name: | |
try calculate A+B | |
run: | | |
echo "Beep boop! Let's try A plus B!" | |
echo "All '*.cpp' files:" | |
find . -name "*.cpp" | |
chmod +x ./make.sh | |
(echo "Y"; echo "Y") | ./make.sh ./demo/A_Plus_B.cpp | |
shell: bash | |
- name: | |
Check A+B result | |
id: | |
check_result | |
run: | | |
if [[ $(cat ./demo/A_Plus_B.ans) != "2034324" ]]; then | |
echo "Beep boop! We were tricked by CCF!" | |
cat ./demo/A_Plus_B.log | |
exit 1 | |
else | |
echo "Beep boop! A+B result is correct!" | |
fi | |
shell: bash | |
- name: | |
Collect results | |
if: | |
steps.check_result.outcome == 'success' | |
run: | |
echo "Beep boop! The check passed successfully!" | |
echo "Beep boop! We successfully fk-ed CCF!" | |
shell: bash |