Skip to content

Commit

Permalink
Run tests on more platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
nosborn committed Jun 8, 2022
1 parent 9771ead commit 82905b0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ jobs:
python-version: 3.x
- uses: pre-commit/action@v3.0.0

local-test:
test:
needs: pre-commit
runs-on: ubuntu-latest
runs-on: ${{ matrix.runs-on }}
env:
NPM_CONFIG_AUDIT: false
NPM_CONFIG_FUND: false
NPM_CONFIG_SEND_METRICS: false
NPM_CONFIG_UPDATE_NOTIFIER: false
steps:
- uses: actions/checkout@v3.0.2
- name: Test problem matcher
Expand Down Expand Up @@ -53,3 +58,15 @@ jobs:
files: .
ignore-path: examples/.markdownlintignore
rules: examples/rules/custom.js
strategy:
matrix:
runs-on:
- macos-10.15
- macos-11
- macos-12
- ubuntu-18.04
- ubuntu-20.04
- ubuntu-22.04
- windows-2016
- windows-2019
- windows-2022
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ repos:
hooks:
- id: actionlint-docker

minimum_pre_commit_version: !!str 2.19
minimum_pre_commit_version: !!str 2.16
10 changes: 8 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,19 @@ runs:
version="$(npm view --json markdownlint-cli@${INPUT_CLI_VERSION:?} | jq -r .version)"
major_version="$(cut -d . -f 1 <<<"${version}")"
minor_version="$(cut -d . -f 2 <<<"${version}")"
prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}/markdownlint-cli/${version}"
case "${RUNNER_OS:?}" in
Windows) prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}\\markdownlint-cli\\${version}" ;;
*) prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}/markdownlint-cli/${version}" ;;
esac
mkdir -p "${prefix}"
# FIXME: --global and --production are deprecated
NPM_CONFIG_PREFIX="${prefix}" npm install --global --production "markdownlint-cli@${version}"
echo '::endgroup::'
markdownlint="${prefix}/bin/markdownlint"
case "${RUNNER_OS:?}" in
Windows) markdownlint="${prefix}\\markdownlint" ;;
*) markdownlint="${prefix}/bin/markdownlint" ;;
esac
markdownlint+="${INPUT_CONFIG_FILE:+ -c ${INPUT_CONFIG_FILE:?}}"
if [[ ${major_version} -gt 0 ]] || [[ ${minor_version} -ge 30 ]]; then
markdownlint+="${INPUT_DISABLE:+ --disable ${INPUT_DISABLE:?}}"
Expand Down

0 comments on commit 82905b0

Please sign in to comment.