-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add yamllint and workflow Signed-off-by: Robert Marklund <[email protected]>
- Loading branch information
1 parent
6626b26
commit e22a83e
Showing
4 changed files
with
90 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,23 @@ | ||
--- | ||
name: run shellcheck on scripts | ||
|
||
"on": | ||
push: | ||
branches: | ||
- main | ||
- devel | ||
pull_request: | ||
|
||
|
||
jobs: | ||
build: | ||
name: Runs the shellcheck on scripts | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: install packages | ||
run: sudo apt install shellcheck | ||
- name: run shellcheck | ||
run: ./do_shellcheck.sh |
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,25 @@ | ||
--- | ||
name: run yamllint on files | ||
|
||
"on": | ||
push: | ||
branches: | ||
- main | ||
- devel | ||
pull_request: | ||
|
||
|
||
jobs: | ||
build: | ||
name: Runs the yamllint on files | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v4 | ||
- name: install packages | ||
run: sudo apt install python3 | ||
- name: install yamllint | ||
run: python3 -m venv .venv && .venv/bin/python3 -m pip install yamllint | ||
- name: run yamllint | ||
run: ./do_yamllint.sh |
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,21 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
me=$(basename "$0") | ||
|
||
|
||
echo "$me: run shellcheck on shellscripts" | ||
( | ||
# use this when all issues are fixed | ||
# git ls-files | grep -v "^testcases" | grep -E ".sh$" | xargs shellcheck | ||
shellcheck do_shellcheck.sh do_yamllint.sh | ||
) | ||
|
||
echo "$me: run shellcheck on testcases" | ||
( | ||
# use this when all issues are fixed | ||
# cd testcases && git ls-files | grep -E ".sh$" | xargs shellcheck -x | ||
cd testcases && shellcheck -x ./checksum_buffersize*.sh | ||
) | ||
|
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,21 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
YMLLINT="" | ||
if which yamllint >/dev/null 2>/dev/null; then | ||
YMLLINT="yamllint" | ||
elif [ -f .venv/bin/yamllint ]; then | ||
YMLLINT=".venv/bin/yamllint" | ||
else | ||
echo "could not find yamllint please install" | ||
echo "for debian based systems: apt -y install libxml2-utils" | ||
echo "for redhat based systems: dnf install yamllint" | ||
echo "local install: python3 -m venv .venv && .venv/bin/python3 -m pip install yamllint" | ||
exit 3 | ||
fi | ||
|
||
# run this when all issues are fixed | ||
# git ls-files | grep -E "*.yml$" | xargs "$YMLLINT" | ||
|
||
"$YMLLINT" .github/workflows/shellcheck.yml .github/workflows/yamllint.yml |