-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add Pr-Check Bash Script workflow
- Loading branch information
1 parent
3be0887
commit 7612dd4
Showing
1 changed file
with
46 additions
and
0 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,46 @@ | ||
name: Pr-Check Bash Script | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test-script: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set execute permissions | ||
run: chmod +x ./usr/bin/clean_memory.sh | ||
|
||
- name: Run the Bash script | ||
id: run_script | ||
run: | | ||
# Execute the script and capture output | ||
sudo ./usr/bin/clean_memory.sh | tee script_output.log | ||
- name: Verify script output | ||
run: | | ||
# Check if the script produced output indicating it ran | ||
if grep -q "Values before" script_output.log && grep -q "Values now" script_output.log; then | ||
echo "Script executed successfully." | ||
else | ||
echo "Script failed to execute properly." | ||
exit 1 | ||
fi | ||
- name: Verify script logs | ||
run: | | ||
# Ensure that certain expected outputs are present in the logs | ||
if grep -q "Cleaning Memory..." script_output.log; then | ||
echo "Memory cleaning step executed." | ||
else | ||
echo "Memory cleaning step missing." | ||
exit 1 | ||
fi |