Skip to content

Commit

Permalink
feat(tests): add schema test coverage
Browse files Browse the repository at this point in the history
* add markdownlint config
* add package-lock.json

reused from OAS/Overlay projects
  • Loading branch information
jeremyfiel committed Nov 22, 2024
1 parent d02cff6 commit 7263e27
Show file tree
Hide file tree
Showing 18 changed files with 5,192 additions and 440 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/schema-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: schema-tests

# Author: @MikeRalphson / runs @jdesrosiers tests
# Issue: https://github.com/OAI/OpenAPI-Specification/pull/2489

#
# This workflow runs the npm test script to validate passing and failing
# testcases for the metaschemas
#

# run this on push to any branch and creation of pull-requests
on:
push: {}
pull_request: {}
workflow_dispatch: {}

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4 # checkout repo content
with:
fetch-depth: 0

- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '20.x'

- name: Install dependencies from main
run: |
# git checkout remotes/origin/main -- package.json package-lock.json #TODO: uncomment with subsequent PR
npm ci
- name: Run tests
run: npm test
22 changes: 14 additions & 8 deletions .github/workflows/validate-markdown.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: validate-markdown

# Author: @MikeRalphson
# Issue: https://github.com/OAI/OpenAPI-Specification/issues/2130
# Author: @ralfhandl based on work of @MikeRalphson
# Issue: https://github.com/OAI/Overlay-Specification/issues/53

#
# This workflow validates files in the versions directory matching 1.*.md
# This workflow validates markdown files in the versions directory matching *.md
#

# run this on push to any branch and creation of pull-requests
Expand All @@ -16,10 +16,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2 # checkout repo content
- uses: actions/setup-node@v1 # setup Node.js
- uses: actions/checkout@v4 # checkout repo content
with:
node-version: '18.x'
fetch-depth: 0
# - name: use the javascript environment from main
# run: |
# git checkout remotes/origin/main -- package.json package-lock.json .markdownlint.yaml
- uses: actions/setup-node@v4 # setup Node.js
with:
node-version: '20.x'
- name: Validate markdown
run: npx mdv versions/1.*.md

run: npx --yes mdv versions/*.md
- name: Lint markdown
run: npx --yes markdownlint-cli --config .markdownlint.yaml versions/*.md
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ node_modules/
deploy/
history
Gemfile.lock
coverage/
12 changes: 12 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Unordered list indentation
MD007:
indent: 2

MD012: false # allow blank lines

MD013:
line_length: 800
tables: false

MD024: false # duplicate headings
MD033: false # inline HTML
Loading

0 comments on commit 7263e27

Please sign in to comment.