Skip to content

Commit 82905b0

Browse files
committed
Run tests on more platforms
1 parent 9771ead commit 82905b0

3 files changed

Lines changed: 28 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ jobs:
2323
python-version: 3.x
2424
- uses: pre-commit/action@v3.0.0
2525

26-
local-test:
26+
test:
2727
needs: pre-commit
28-
runs-on: ubuntu-latest
28+
runs-on: ${{ matrix.runs-on }}
29+
env:
30+
NPM_CONFIG_AUDIT: false
31+
NPM_CONFIG_FUND: false
32+
NPM_CONFIG_SEND_METRICS: false
33+
NPM_CONFIG_UPDATE_NOTIFIER: false
2934
steps:
3035
- uses: actions/checkout@v3.0.2
3136
- name: Test problem matcher
@@ -53,3 +58,15 @@ jobs:
5358
files: .
5459
ignore-path: examples/.markdownlintignore
5560
rules: examples/rules/custom.js
61+
strategy:
62+
matrix:
63+
runs-on:
64+
- macos-10.15
65+
- macos-11
66+
- macos-12
67+
- ubuntu-18.04
68+
- ubuntu-20.04
69+
- ubuntu-22.04
70+
- windows-2016
71+
- windows-2019
72+
- windows-2022

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ repos:
3232
hooks:
3333
- id: actionlint-docker
3434

35-
minimum_pre_commit_version: !!str 2.19
35+
minimum_pre_commit_version: !!str 2.16

action.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,19 @@ runs:
5454
version="$(npm view --json markdownlint-cli@${INPUT_CLI_VERSION:?} | jq -r .version)"
5555
major_version="$(cut -d . -f 1 <<<"${version}")"
5656
minor_version="$(cut -d . -f 2 <<<"${version}")"
57-
prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}/markdownlint-cli/${version}"
57+
case "${RUNNER_OS:?}" in
58+
Windows) prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}\\markdownlint-cli\\${version}" ;;
59+
*) prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}/markdownlint-cli/${version}" ;;
60+
esac
5861
mkdir -p "${prefix}"
5962
# FIXME: --global and --production are deprecated
6063
NPM_CONFIG_PREFIX="${prefix}" npm install --global --production "markdownlint-cli@${version}"
6164
echo '::endgroup::'
6265
63-
markdownlint="${prefix}/bin/markdownlint"
66+
case "${RUNNER_OS:?}" in
67+
Windows) markdownlint="${prefix}\\markdownlint" ;;
68+
*) markdownlint="${prefix}/bin/markdownlint" ;;
69+
esac
6470
markdownlint+="${INPUT_CONFIG_FILE:+ -c ${INPUT_CONFIG_FILE:?}}"
6571
if [[ ${major_version} -gt 0 ]] || [[ ${minor_version} -ge 30 ]]; then
6672
markdownlint+="${INPUT_DISABLE:+ --disable ${INPUT_DISABLE:?}}"

0 commit comments

Comments
 (0)