@cypress/github-action 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +37 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -75355,9 +75355,46 @@ const runTests = async () => {
75355
75355
  process.chdir(workingDirectory)
75356
75356
  return cypress
75357
75357
  .run(cypressOptions)
75358
+ .then(generateSummary)
75358
75359
  .then(onTestsFinished, onTestsError)
75359
75360
  }
75360
75361
 
75362
+ const generateSummary = async (testResults) => {
75363
+ const headers = [
75364
+ { data: 'Result', header: true },
75365
+ { data: 'Passed :white_check_mark:', header: true },
75366
+ { data: 'Failed :x:', header: true },
75367
+ { data: 'Pending :hand:', header: true },
75368
+ { data: 'Skipped :leftwards_arrow_with_hook:', header: true },
75369
+ { data: 'Duration :clock8:', header: true }
75370
+ ]
75371
+
75372
+ const status =
75373
+ testResults.totalFailed === 0
75374
+ ? 'Passing :white_check_mark:'
75375
+ : 'Failing :red_circle:'
75376
+
75377
+ const summaryRows = [
75378
+ status,
75379
+ `${testResults.totalPassed}`,
75380
+ `${testResults.totalFailed}`,
75381
+ `${testResults.totalPending}`,
75382
+ `${testResults.totalSkipped}`,
75383
+ `${testResults.totalDuration / 1000}s` || ''
75384
+ ]
75385
+
75386
+ await core.summary
75387
+ .addHeading('Cypress Results', 2)
75388
+ .addTable([headers, summaryRows])
75389
+ .addLink(
75390
+ testResults.runUrl ? 'View Run in Dashboard' : '',
75391
+ testResults.runUrl || ''
75392
+ )
75393
+ .write()
75394
+
75395
+ return testResults
75396
+ }
75397
+
75361
75398
  const installMaybe = () => {
75362
75399
  const installParameter = getInputBool('install', true)
75363
75400
  if (!installParameter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "description": "GitHub Action for running Cypress end-to-end tests",
5
5
  "private": false,
6
6
  "main": "dist/index.js",