Skip to content

Commit 3abb981

Browse files
[actions] Add shellcheck workflow
Co-authored-by: Alex Aubuchon <[email protected]> Co-authored-by: Jordan Harband <[email protected]>
1 parent 21c0c05 commit 3abb981

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

.github/workflows/shellcheck.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Tests: shellcheck"
2+
3+
on: [pull_request, push]
4+
5+
jobs:
6+
shellcheck:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
shell:
11+
- bash
12+
- sh
13+
- dash
14+
- ksh
15+
file:
16+
- nvm.sh
17+
include:
18+
- shell: bash
19+
file: install.sh # only supported on bash
20+
- shell: bash
21+
file: bash_completion # only needed in bash/zsh
22+
- shell: bash
23+
file: nvm-exec # only runs in bash
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: Install shellcheck
28+
run: brew install shellcheck
29+
- run: "shellcheck --version"
30+
- name: Run shellcheck on ${{ matrix.file }}
31+
run: shellcheck -s ${{ matrix.shell }} ${{ matrix.file }}

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ before_install:
1818
- $SHELL --version 2> /dev/null || dpkg -s $SHELL 2> /dev/null || which $SHELL
1919
- curl --version
2020
- wget --version
21-
- shellcheck --version
2221
install:
2322
- if [ -z "${SHELLCHECK-}" ]; then nvm install node && npm install && npm prune && npm ls urchin doctoc eclint dockerfile_lint; fi
2423
- '[ -z "$WITHOUT_CURL" ] || sudo apt-get remove curl -y'
@@ -27,8 +26,6 @@ script:
2726
- if [ -n "${DOCTOCCHECK-}" ]; then cp README.md README.md.orig && npm run doctoc && diff -q README.md README.md.orig ; fi
2827
- if [ -n "${ECLINT-}" ]; then npm run eclint ; fi
2928
- if [ -n "${DOCKERFILE_LINT-}" ]; then npm run dockerfile_lint ; fi
30-
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash nvm.sh && shellcheck -s sh nvm.sh && shellcheck -s dash nvm.sh && shellcheck -s ksh nvm.sh ; fi
31-
- if [ -n "${SHELLCHECK-}" ]; then shellcheck -s bash install.sh bash_completion nvm-exec ; fi
3229
- if [ -n "${SHELL-}" ] && [ -n "${TEST_SUITE}" ]; then if [ "${TEST_SUITE}" = 'installation_iojs' ]; then travis_retry make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL ; else make TEST_SUITE=$TEST_SUITE URCHIN="$(npm bin)/urchin" test-$SHELL; fi; fi
3330
before_cache:
3431
- if [ -n "$WITHOUT_CURL" ]; then sudo apt-get install curl -y ; fi
@@ -43,7 +40,6 @@ env:
4340
matrix:
4441
- MAKE_RELEASE=true
4542
- DOCTOCCHECK=true
46-
- SHELLCHECK=true
4743
- ECLINT=true
4844
- DOCKERFILE_LINT=true
4945
- SHELL=bash TEST_SUITE=install_script

0 commit comments

Comments
 (0)