mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
…-realsies" This reverts commit 3c8700cbc7502e56cca8d4bb77a08e1ee747c166. I'm not sure how this happened but I accidentally hit up + enter on a previous `ghstack land` command for a different stack and it landed this one. Infuriating.
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
name: test262
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test262:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18.x
|
|
cache: "yarn"
|
|
cache-dependency-path: forget/yarn.lock
|
|
- run: yarn install --immutable --immutable-cache
|
|
working-directory: forget
|
|
- run: yarn build
|
|
working-directory: forget
|
|
- id: test262
|
|
name: Run test262
|
|
run: echo results="$(yarn run --silent test262:ci)" >> $GITHUB_OUTPUT
|
|
working-directory: forget
|
|
- id: format_test262_results
|
|
name: Format test262 results
|
|
uses: actions/github-script@v6
|
|
with:
|
|
script: |
|
|
let pass = 0;
|
|
let fail = 0;
|
|
const toPercent = (a, b) => `${Math.floor((a/b) * 100)}%`;
|
|
const results = JSON.parse(${{ steps.test262.outputs.results }});
|
|
for (const result of results) {
|
|
if (result.pass) {
|
|
pass += result.count;
|
|
} else {
|
|
fail += result.count;
|
|
}
|
|
}
|
|
const total = pass + fail;
|
|
const comment = results
|
|
.filter((result) => result.pass === false)
|
|
.map((result) => `- ${result.message}: ${result.count}`)
|
|
.join('\n');
|
|
const totals = `Pass: ${pass} (${toPercent(pass, total)})\nFail: ${fail} (${toPercent(fail, total)})`
|
|
core.setOutput("totals", totals);
|
|
core.setOutput("comment", comment);
|
|
- name: Create commit comment
|
|
uses: peter-evans/commit-comment@v2
|
|
with:
|
|
body: |
|
|
## Test262 Results
|
|
|
|
### Summary
|
|
```
|
|
${{ steps.format_test262_results.outputs.totals }}
|
|
```
|
|
|
|
### Failure Details
|
|
${{ steps.format_test262_results.outputs.comment }}
|