-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add code lint “shellcheck” to github actions and configured cod…
…acy (#9) Create a complete workflow for the repository: 1. Automation A+B test. 2. `shellcheck` test. 3. Codacy code lint.
- Loading branch information
1 parent
cd1dd9d
commit 2300da9
Showing
6 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
engines: | ||
shellcheck: | ||
enabled: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
demo/** | ||
.github/** | ||
README.md | ||
README_zh-CN.md |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Greetings | ||
name: Greet new contributors | ||
|
||
on: [pull_request_target, issues] | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Shell check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
shellcheck: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: FKCCF everyday | ||
run: | | ||
echo "Beep boop! shellcheck was triggered..." | ||
echo "I would say, FKCCF!" | ||
- name: Clone repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Show status | ||
run: | | ||
echo "repo was cloned successfully!" | ||
- name: shellcheck | ||
uses: ludeeus/action-shellcheck@00b27aa7cb85167568cb48a3838b75f4265f2bca | ||
|
||
- name: Finish | ||
run: | | ||
echo "Beep boop! shellcheck finished!" | ||
echo "Beep boop! You are able to request a review now." |
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