2021-01-14 00:08:22 +01:00
|
|
|
name: Test markdownlint-cli2-action
|
2021-01-13 07:19:56 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
2023-09-17 19:59:26 +02:00
|
|
|
branches-ignore:
|
|
|
|
- 'dependabot/**'
|
2021-01-13 07:19:56 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2021-01-16 05:44:36 +01:00
|
|
|
test-script:
|
|
|
|
name: Run test script
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-10-24 11:23:44 +02:00
|
|
|
- uses: actions/setup-node@v4
|
2022-08-04 06:02:44 +02:00
|
|
|
- run: npm install
|
2021-01-16 05:44:36 +01:00
|
|
|
- run: npm run test
|
2021-01-14 00:08:22 +01:00
|
|
|
no-globs:
|
2022-07-23 08:16:36 +02:00
|
|
|
name: No globs (README.md, 0 errors)
|
2021-01-13 07:19:56 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-14 00:08:22 +01:00
|
|
|
- uses: ./
|
2022-07-23 22:28:59 +02:00
|
|
|
one-glob-file:
|
2022-07-23 08:16:36 +02:00
|
|
|
name: One glob (test/errors.md, 3 errors)
|
2021-01-14 00:08:22 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-14 00:08:22 +01:00
|
|
|
- uses: ./
|
2021-01-13 23:29:36 +01:00
|
|
|
with:
|
2021-01-13 23:50:05 +01:00
|
|
|
globs: test/errors.md
|
2022-09-14 06:07:05 +02:00
|
|
|
continue-on-error: true
|
|
|
|
id: test
|
|
|
|
- run: exit 1
|
|
|
|
if: steps.test.outcome != 'failure'
|
2022-07-23 22:28:59 +02:00
|
|
|
one-glob-pattern:
|
2023-06-11 05:35:20 +02:00
|
|
|
name: One glob (README.md, 0 errors)
|
2022-07-23 22:28:59 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-07-23 22:28:59 +02:00
|
|
|
- uses: ./
|
|
|
|
with:
|
|
|
|
globs: '*.md'
|
2021-01-14 00:08:22 +01:00
|
|
|
two-globs:
|
2022-07-23 08:16:36 +02:00
|
|
|
name: Two globs (README.md and test/errors.md, 3 errors)
|
2021-01-14 00:08:22 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-14 00:08:22 +01:00
|
|
|
- uses: ./
|
2021-01-13 23:50:05 +01:00
|
|
|
with:
|
|
|
|
globs: |
|
|
|
|
*.md
|
2021-01-14 00:08:22 +01:00
|
|
|
test/*
|
2022-09-14 06:07:05 +02:00
|
|
|
continue-on-error: true
|
|
|
|
id: test
|
|
|
|
- run: exit 1
|
|
|
|
if: steps.test.outcome != 'failure'
|
2022-11-30 04:29:42 +01:00
|
|
|
separator:
|
|
|
|
name: Separator (README.md and test/errors.md, 3 errors)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2022-11-30 04:29:42 +01:00
|
|
|
- uses: ./
|
|
|
|
with:
|
|
|
|
globs: '*.md,test/*'
|
|
|
|
separator: ','
|
|
|
|
continue-on-error: true
|
|
|
|
id: test
|
|
|
|
- run: exit 1
|
|
|
|
if: steps.test.outcome != 'failure'
|
2023-06-11 05:35:20 +02:00
|
|
|
config:
|
|
|
|
name: config (test/errors.md, 2 errors)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-11 05:35:20 +02:00
|
|
|
- run: rm .markdownlint.json
|
|
|
|
- uses: ./
|
|
|
|
with:
|
|
|
|
config: 'config/test.markdownlint.jsonc'
|
|
|
|
globs: 'test/*'
|
|
|
|
continue-on-error: true
|
|
|
|
id: test
|
|
|
|
- run: exit 1
|
|
|
|
if: steps.test.outcome != 'failure'
|
|
|
|
config-invalid:
|
|
|
|
name: config (invalid configuration file, fails)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-11 05:35:20 +02:00
|
|
|
- uses: ./
|
|
|
|
with:
|
|
|
|
config: 'invalid.markdownlint.jsonc'
|
|
|
|
globs: 'test/*'
|
|
|
|
continue-on-error: true
|
|
|
|
id: test
|
|
|
|
- run: exit 1
|
|
|
|
if: steps.test.outcome != 'failure'
|
|
|
|
fix:
|
|
|
|
name: fix (test/errors.md, 0 errors)
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-09-05 18:10:21 +02:00
|
|
|
- uses: actions/checkout@v4
|
2023-06-11 05:35:20 +02:00
|
|
|
- uses: ./
|
|
|
|
with:
|
|
|
|
fix: true
|
|
|
|
globs: 'test/*'
|