-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.34 KB
/
pr-check.yml
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
name: Pr-Check Bash Script
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
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
if grep -q "by: Gabriel Logan" script_output.log; then
echo "Author information present."
else
echo "Author information missing."
exit 1
fi