-
Notifications
You must be signed in to change notification settings - Fork 16
53 lines (48 loc) · 1.3 KB
/
prs.yaml
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
name: prs
on:
pull_request:
paths:
- "tools/*"
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
scandir: "./tools"
ignore_paths: "**.py"
- name: Check Permissions
run: |
# Executable bit indices
USER_EXEC_IND=3
GROUP_EXEC_IND=6
ELSE_EXEC_IND=9
for FILE in tools/*; do
PERMISSIONS=$(stat -c "%A" "${FILE}")
for IND in "${USER_EXEC_IND}" "${GROUP_EXEC_IND}" "${ELSE_EXEC_IND}"; do
EXEC_PERM="${PERMISSIONS:$IND:1}"
if [ "${EXEC_PERM}" != "x" ]; then
ls -l tools/
echo ""
echo "${FILE} does not have the correct permissions."
echo "Ensure are tools are executable by everyone and try again."
exit 1
fi
done
done
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run pytest
run: |
pip install pytest
pytest tests