Files
react/compiler/.github/workflows/test262.yml
T
lauren 7ee40764e6 Revert "[nocommit] Run test262 on this PR to verify it works for real…
…-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.
2022-12-22 17:53:59 -05:00

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 }}