Add CI step to detect possible problematic usage of trap
see for example this change: https://github.com/osbuild/osbuild-composer/pull/3681/commits/13a3ca24ceef05164a77db1c71b929e262098f41
This commit is contained in:
parent
1fa98e4253
commit
c534689d57
1 changed files with 15 additions and 0 deletions
15
.github/workflows/tests.yml
vendored
15
.github/workflows/tests.yml
vendored
|
|
@ -215,6 +215,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
|
|
||||||
- name: Run ShellCheck
|
- name: Run ShellCheck
|
||||||
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
|
uses: ludeeus/action-shellcheck@00cae500b08a931fb5698e11e79bfbd38e612a38
|
||||||
with:
|
with:
|
||||||
|
|
@ -224,6 +225,20 @@ jobs:
|
||||||
# allow seemingly unreachable commands
|
# allow seemingly unreachable commands
|
||||||
SHELLCHECK_OPTS: -e SC1091 -e SC2002 -e SC2317
|
SHELLCHECK_OPTS: -e SC1091 -e SC2002 -e SC2317
|
||||||
|
|
||||||
|
- name: Do not doube trap signals inside test scripts
|
||||||
|
run: |
|
||||||
|
FILES_WITH_DOUBLE_TRAP=$(grep trap test/cases/* -R | cut -f1 -d: | sort | uniq -c | grep -v 1 || echo -n)
|
||||||
|
|
||||||
|
echo "INFO: ----- files with possible double calls to 'trap' -----"
|
||||||
|
echo "$FILES_WITH_DOUBLE_TRAP"
|
||||||
|
echo "---------- END ----------"
|
||||||
|
|
||||||
|
if [ -n "$FILES_WITH_DOUBLE_TRAP" ]; then
|
||||||
|
echo "FAIL: Do not double 'trap' signals"
|
||||||
|
echo "INFO: because this may lead to cleanup() function not being executed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
rpmlint:
|
rpmlint:
|
||||||
name: "📦 RPMlint"
|
name: "📦 RPMlint"
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue