-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
ci: Add CI check for Parse Server options definitions #7955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
847f156
chore(release): 5.2.1-alpha.1 [skip ci]
semantic-release-bot 8987627
feat: add definitions CI check
dblythy 84dd8a3
type
dblythy dc882f4
Update checkDefinitions.js
dblythy d413d6d
Update ci.yml
dblythy 7a7b8d9
Update checkDefinitions.js
dblythy 6b09c20
Update checkDefinitions.js
dblythy 6da828a
Update checkDefinitions.js
dblythy 131f350
Merge branch 'definitions-ci-check' of https://github.com/dblythy/par…
dblythy 23d5cf4
Merge branch 'definitions-ci-check' of https://github.com/dblythy/par…
dblythy 825c5fa
Merge branch 'definitions-ci-check' of https://github.com/dblythy/par…
dblythy 616e3a4
update
dblythy d86ec46
check src
dblythy 9496e2d
fix
dblythy 23d3b6a
Merge branch 'alpha' into definitions-ci-check
mtrezza 98cfa34
Merge branch 'alpha' into definitions-ci-check
dblythy 1412ac8
Update ci.yml
dblythy 5efe65e
Update definitionsCheck.js
dblythy c79ce0d
Update definitionsCheck.js
dblythy bac45d4
Update definitionsCheck.js
dblythy 2c98de8
Update definitionsCheck.js
dblythy a853807
add ci check
dblythy cc48359
Update package.json
dblythy fb877c8
add abort
dblythy fd1e1e5
Update Definitions.js
dblythy 2902fe0
Update definitionsCheck.js
dblythy d4e3ae6
Merge branch 'alpha' into definitions-ci-check
dblythy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,39 @@ | ||
const fs = require('fs').promises; | ||
const { exec } = require('child_process'); | ||
const core = require('@actions/core'); | ||
const { nextTick } = require('process'); | ||
const { AbortController } = require("node-abort-controller"); | ||
(async () => { | ||
const [currentDefinitions, currentDocs] = await Promise.all([ | ||
fs.readFile('./src/Options/Definitions.js', 'utf8'), | ||
fs.readFile('./src/Options/docs.js', 'utf8'), | ||
]); | ||
exec('npm run definitions'); | ||
const ac = new AbortController(); | ||
const { signal } = ac; | ||
const watcher = fs.watch('./src/Options/docs.js', {signal}); | ||
let i = 0; | ||
// eslint-disable-next-line | ||
for await (const _ of watcher) { | ||
i++; | ||
if (i === 3) { | ||
ac.abort(); | ||
break; | ||
} | ||
} | ||
await new Promise(resolve => nextTick(resolve)); | ||
const [newDefinitions, newDocs] = await Promise.all([ | ||
fs.readFile('./src/Options/Definitions.js', 'utf8'), | ||
fs.readFile('./src/Options/docs.js', 'utf8'), | ||
]); | ||
if (currentDefinitions !== newDefinitions || currentDocs !== newDocs) { | ||
console.error( | ||
'\x1b[31m%s\x1b[0m', | ||
'Definitions files cannot be updated manually. Please update src/Options/index.js then run `npm run definitions` to generate definitions.' | ||
); | ||
core.error('Definitions files cannot be updated manually. Please update src/Options/index.js then run `npm run definitions` to generate definitions.'); | ||
process.exit(1); | ||
} else { | ||
process.exit(0); | ||
} | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.