-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test and github workflows (#7)
- Loading branch information
1 parent
6480eb3
commit 259d11b
Showing
7 changed files
with
128 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Release GitHub | ||
|
||
on: | ||
push: | ||
branches: [release/*] | ||
|
||
jobs: | ||
create-github-release: | ||
name: Create GitHub Release and Git tag | ||
runs-on: ubuntu-latest | ||
environment: Release | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cucumber/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Release NPM | ||
|
||
on: | ||
push: | ||
branches: [release/*] | ||
|
||
jobs: | ||
publish-npm: | ||
name: Publish NPM module | ||
runs-on: ubuntu-latest | ||
environment: Release | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: package-lock.json | ||
- run: npm install-test | ||
- uses: cucumber/[email protected] | ||
with: | ||
npm-token: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- renovate/** | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_call: | ||
|
||
jobs: | ||
test-javascript: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
cache: 'npm' | ||
cache-dependency-path: package-lock.json | ||
- run: npm install-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {equal} from 'node:assert/strict' | ||
import {readFileSync} from 'node:fs' | ||
import {describe, it} from 'node:test' | ||
import {Validator} from 'jsonschema' | ||
|
||
const FILENAMES = [ | ||
'behave.json', | ||
'canonical.json', | ||
'cucumber-js.json', | ||
'cucumber-jvm.json', | ||
'cucumber-ruby.json', | ||
] | ||
|
||
describe('schema validation', () => { | ||
const validator = new Validator() | ||
|
||
FILENAMES.forEach(filename => { | ||
it(filename, async () => { | ||
const schema = JSON.parse(readFileSync('./schemas/' + filename, {encoding: 'utf-8'})) | ||
const metaSchema = await fetch(schema['$schema']).then(response => response.json()) | ||
const result = validator.validate(schema, metaSchema) | ||
equal(result.valid, true) | ||
}) | ||
}) | ||
}) |