Skip to content

Commit

Permalink
[build][s]: add buildschemas to the gh workflows integration tests (o…
Browse files Browse the repository at this point in the history
…/w they would fail!).

* Also add some console logs to the build.js so more verbose.
  • Loading branch information
rufuspollock authored and lauragift21 committed May 5, 2020
1 parent cfa5ffc commit 9d627db
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
run: npm install
- name: Build
run: npm run build
- name: Build Schemas
run: npm run buildschemas
- name: Run tests
run: npm run test
deploy:
Expand Down
4 changes: 2 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ function compileDictionary() {
'$schema': 'http://json-schema.org/draft-04/schema#',
definitions: {}
}

// Fill dictionary
for (const file of glob.sync('schemas/dictionary/*.yml')) {
const contents = fs.readFileSync(file)
Object.assign(dictionary.definitions, yaml.safeLoad(contents))
}

// Save dictionary
const contents = JSON.stringify(dictionary, null, 2)
fs.writeFileSync('schemas/dictionary.json', contents)
Expand All @@ -45,6 +43,7 @@ async function buildSchemas() {
const contents = JSON.stringify(schema, null, 2)
fs.writeFileSync(`${BUILD_DIR}/${basename}`, contents)
}
console.log('Built Schemas')
}


Expand All @@ -55,6 +54,7 @@ function buildRegistry() {
const registry = csvParseSync(fs.readFileSync('schemas/registry.csv'), {columns: true})
const contents = JSON.stringify(registry, null, 2)
fs.writeFileSync(`${BUILD_DIR}/registry.json`, contents)
console.log('Built registry')
}


Expand Down

0 comments on commit 9d627db

Please sign in to comment.