Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for running on windows and macos #46

Merged
merged 22 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ on: [pull_request]
jobs:
shellcheck:
name: runner / shellcheck
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v3
- name: shellcheck-github-pr-check
Expand Down
18 changes: 16 additions & 2 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,23 @@ set -u
echo '::group:: Installing shellcheck ... https://github.com/koalaman/shellcheck'
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
TEMP_PATH="$(mktemp -d)"
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
cd "${TEMP_PATH}" || exit
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJf -
mkdir bin
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
cp "shellcheck-v$SHELLCHECK_VERSION/shellcheck" ./bin

jackton1 marked this conversation as resolved.
Show resolved Hide resolved
WINDOWS_TARGET=zip
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
LINUX_TARGET=linux.x86_64.tar.xz
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
MACOS_TARGET=darwin.x86_64.tar.xz
jackton1 marked this conversation as resolved.
Show resolved Hide resolved

jackton1 marked this conversation as resolved.
Show resolved Hide resolved
if [[ $(uname -s) == "Linux" ]]; then
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.${LINUX_TARGET}" | tar -xJf -
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
cp "shellcheck-v$SHELLCHECK_VERSION/shellcheck" ./bin
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
elif [[ $(uname -s) == "Darwin" ]]; then
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.${MACOS_TARGET}" | tar -xJf -
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
cp "shellcheck-v$SHELLCHECK_VERSION/shellcheck" ./bin
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
else
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.${WINDOWS_TARGET}" -o "shellcheck-v${SHELLCHECK_VERSION}.${WINDOWS_TARGET}" && unzip "shellcheck-v${SHELLCHECK_VERSION}.${WINDOWS_TARGET}" && rm "shellcheck-v${SHELLCHECK_VERSION}.${WINDOWS_TARGET}"
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
cp "shellcheck.exe" ./bin
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
fi
jackton1 marked this conversation as resolved.
Show resolved Hide resolved

jackton1 marked this conversation as resolved.
Show resolved Hide resolved
PATH="${TEMP_PATH}/bin:$PATH"
jackton1 marked this conversation as resolved.
Show resolved Hide resolved
echo '::endgroup::'
jackton1 marked this conversation as resolved.
Show resolved Hide resolved

jackton1 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down