put platform and arch into commit message status object

This commit is contained in:
Gleb Bahmutov
2019-04-19 12:53:10 -04:00
parent 3a444482d2
commit c55cc089ef
2 changed files with 18 additions and 2 deletions

View File

@@ -176,7 +176,6 @@ module.exports = {
# the test projects will exercise the new version of
# the Cypress test runner we just built
runTestProjects: (getStatusAndMessage, providerName, version) ->
# status is {owner, repo, sha}
projectFilter = getFilterByProvider(providerName)
@@ -217,6 +216,18 @@ module.exports = {
createGithubCommitStatusCheck = ({ sha }) ->
return if not status
# status is {owner, repo, sha} and maybe a few other properties
isStatus = check.schema({
owner: check.unemptyString,
repo: check.unemptyString,
sha: check.commitId,
context: check.unemptyString,
platform: check.unemptyString,
arch: check.unemptyString
})
if not isStatus(status)
console.error("Invalid status object %o", status)
targetUrl = "https://github.com/#{owner}/#{repo}/commit/#{sha}"
commitStatusOptions = {
targetUrl,

View File

@@ -98,11 +98,16 @@ const getStatusAndMessage = (projectRepoName) => {
if (commit && is.commitId(commit)) {
// commit is full 40 character hex string
const platform = os.platform()
const arch = os.arch()
status = {
owner: 'cypress-io',
repo: 'cypress',
sha: commit,
context: `[${os.platform()}-${os.arch()}] ${projectRepoName}`,
platform,
arch,
context: `[${platform}-${arch}] ${projectRepoName}`,
}
}