Skip to content

Commit

Permalink
GHA: check shell/install.sh using shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate authored and rjbou committed Dec 2, 2024
1 parent abaef66 commit 1004840
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/scripts/main/hygiene.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,17 @@ please run dune exec --root=. -- ./ci.exe from .github/workflows and fixup the c
fi
(set +x ; echo -en "::endgroup::check workflow generation\r") 2>/dev/null

###
# Shellcheck
###

(set +x ; echo -en "::group::check shell scripts using shellcheck\r") 2>/dev/null
if shellcheck shell/install.sh ; then
(set +x; echo "shell/install.sh: OK") 2>/dev/null
else
(set +x; echo -e "shell/install.sh: \e[31mERROR\e[0m") 2>/dev/null
ERROR=1
fi
(set +x ; echo -en "::endgroup::check shell scripts using shellcheck\r") 2>/dev/null

exit $ERROR
1 change: 1 addition & 0 deletions .github/workflows/ci.ml
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ let hygiene_job (type a) ~analyse_job (platform : a platform) ~oc ~workflow f =
"done";
]
++ run "Hygiene" ~cond:(Or[Predicate(true, Contains("steps.files.outputs.modified", "configure.ac"));
Predicate(true, Contains("steps.files.outputs.modified", "shell/install.sh"));
Predicate(true, Contains("steps.files.outputs.all", "src_ext"));
Predicate(true, Contains("steps.files.outputs.all", ".github/workflows"))])
~env:[("BASE_REF_SHA", "${{ github.event.pull_request.base.sha }}");
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -671,5 +671,5 @@ jobs:
env:
BASE_REF_SHA: ${{ github.event.pull_request.base.sha }}
PR_REF_SHA: ${{ github.event.pull_request.head.sha }}
if: contains(steps.files.outputs.modified, 'configure.ac') || contains(steps.files.outputs.all, 'src_ext') || contains(steps.files.outputs.all, '.github/workflows')
if: contains(steps.files.outputs.modified, 'configure.ac') || contains(steps.files.outputs.modified, 'shell/install.sh') || contains(steps.files.outputs.all, 'src_ext') || contains(steps.files.outputs.all, '.github/workflows')
run: bash -exu .github/scripts/main/hygiene.sh
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ users)
* Add a doc generation job under linux [#5349 @rjbou]
* Update the github action scripts now that homebrew renamed the GNU patch binary to gpatch [#6296 @kit-ty-kate]
* Add branch scheme `username/branch` for opam-rt specific branch to use [#6274 @rjbou]
* Check `shell/install.sh` using `shellcheck` [#6313 @kit-ty-kate]

## Doc
* Update the command to install opam to point to the new simplified url on opam.ocaml.org [#6226 @kit-ty-kate]
Expand Down

0 comments on commit 1004840

Please sign in to comment.