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

add support for mac and arm systems to the github action #1040

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on: [pull_request]
jobs:
shallow:
name: Spell Check with Typos
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
epage marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
Expand All @@ -26,7 +29,10 @@ jobs:

deep:
name: Spell Check with Type w/History
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
Expand Down
18 changes: 15 additions & 3 deletions action/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,25 @@ if [[ -z $(ls ${TARGET} 2>/dev/null) ]]; then
exit 1
fi


if [[ ! -x ${COMMAND} ]]; then
VERSION=1.22.7
if [[ "$(uname -m)" == "arm64" ]]; then
ARCH="aarch64"
else
ARCH="x86_64"
fi
if [[ "$(uname -s)" == "Darwin" ]]; then
TARGET_FILE="${ARCH}-apple-darwin"
else
TARGET_FILE="${ARCH}-unknown-linux-musl"
fi
FILE_NAME="typos-v${VERSION}-${TARGET_FILE}.tar.gz"
log "Downloading 'typos' v${VERSION}"
wget --progress=dot:mega "https://github.com/crate-ci/typos/releases/download/v${VERSION}/typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz"
wget --progress=dot:mega "https://github.com/crate-ci/typos/releases/download/v${VERSION}/${FILE_NAME}"
mkdir -p ${_INSTALL_DIR}
tar -xzvf typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz -C ${_INSTALL_DIR} ./${CMD_NAME}
rm typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz
tar -xzvf "${FILE_NAME}" -C ${_INSTALL_DIR} ./${CMD_NAME}
rm "${FILE_NAME}"
fi
log "jq: $(jq --version)"

Expand Down
Loading