Skip to content

test: add test github workflow #18

test: add test github workflow

test: add test github workflow #18

name: Test against Asciidoctor Versions
on:
push:
branches: [ '**' ]
paths:
- 'lib/**'
- 'test/**'
- 'package.json'
- '.github/workflows/test-asciidoctor.yml'
pull_request:
branches: [ '**' ]
paths:
- 'lib/**'
- 'test/**'
- 'package.json'
- '.github/workflows/test-asciidoctor.yml'
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
asciidoctor-version: ['~2.2', '~3.0']
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci || npm install
- name: Install specific Asciidoctor version
run: npm install --no-save @asciidoctor/core@${{ matrix.asciidoctor-version }}
- name: Run Asciidoctor tests
run: npx jest tests/asciidoctor