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 25fed1d commit a21862a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,27 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.0.2
- uses: actions/setup-python@v3.1.2
- 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
- uses: actions/checkout@v3.0.2
- name: Test problem matcher
id: expect-failure
uses: ./
with:
config: .markdownlintrc
files: .
rules: examples/rules/custom.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- if: ${{ steps.expect-failure.outcome != 'failure' }}
run: |
Expand All @@ -46,14 +49,22 @@ jobs:
files: .
ignore: examples/ignore/*
rules: examples/rules/custom.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test ignore_path
uses: ./
with:
config: .markdownlintrc
files: .
ignore-path: examples/.markdownlintignore
rules: examples/rules/custom.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
13 changes: 11 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,22 @@ 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}"
if [[ "${RUNNER_OS:?}" == Windows ]]; then
prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}/markdownlint-cli/${version}"
else
prefix="${RUNNER_TOOL_CACHE:-${RUNNER_TEMP:?}}\\markdownlint-cli\\${version}"
fi
mkdir -p "${prefix}"
# FIXME: --global and --production are deprecated
NPM_CONFIG_PREFIX="${prefix}" npm install --global --production "markdownlint-cli@${version}"
ls -l "${prefix}"
echo '::endgroup::'
markdownlint="${prefix}/bin/markdownlint"
if [[ "${RUNNER_OS:?}" == Windows ]]; then
markdownlint="${prefix}\\bin\\markdownlint.exe"
else
markdownlint="${prefix}/bin/markdownlint"
fi
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 a21862a

Please sign in to comment.