CI: Move CI code into a single script

This commit is contained in:
Saverio Miroddi 2021-04-24 09:28:40 +02:00
parent df5ce73e76
commit 93289c7c09
2 changed files with 16 additions and 7 deletions

View File

@ -5,10 +5,4 @@ cache:
directories:
- "/opt/shellcheck"
script:
- mkdir -p /opt/shellcheck
- "[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz
| tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck
> /dev/null || true"
- sudo chmod +x /opt/shellcheck/shellcheck
- "/opt/shellcheck/shellcheck --version"
- "/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .)"
- ci/run_shellcheck

15
ci/run_shellcheck.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -o pipefail
set -o errexit
set -o nounset
set -o errtrace
shopt -s inherit_errexit
ci/run_shellcheck mkdir -p /opt/shellcheck
[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz
| tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck
> /dev/null || true
sudo chmod +x /opt/shellcheck/shellcheck
/opt/shellcheck/shellcheck --version
/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .)