Skip to content

Commit

Permalink
Implement PR workflow with test262
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhoosreddy committed Nov 11, 2019
1 parent c2bace4 commit d6a8c02
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions .circleci/config.yml
Expand Up @@ -39,6 +39,9 @@ aliases:
- &artifact_test262_xunit
path: ~/test-results

- &artifact_test262_diff_tap
path: ~/diff.tap

jobs:
test:
working_directory: ~/babel
Expand Down Expand Up @@ -69,6 +72,13 @@ jobs:
- image: circleci/node:12
steps:
- checkout
- run:
name: Sync with latest master branch
command: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git fetch origin master
git rebase origin/master
- restore-cache: *restore-yarn-cache
- restore-cache: *restore-node-modules-cache
- run:
Expand All @@ -86,6 +96,7 @@ jobs:
- run:
name: Setup Test Runner
command: |
# Switch to master branch later
git clone --recurse-submodules https://github.com/babel/babel-test262-runner
cd babel-test262-runner
yarn
Expand All @@ -102,20 +113,49 @@ jobs:
<<: *test262_workdir
- store_artifacts: *artifact_test262_tap
- run:
name: Output test262 results
name: Output Test262 results
command: |
cat ~/test262.tap | $(npm bin)/tap-mocha-reporter spec || true
<<: *test262_workdir
- run:
name: Download master branch Test262 artifact
command: node lib/download-master-artifact ~/master.tap
<<: *test262_workdir
- run:
name: Compare previous master branch & current job results
command: |
mkdir -p ~/test-results/test262
node lib/compare-results ~/master.tap ~/test262.tap | $(npm bin)/tap-merge | tee ~/diff.tap
<<: *test262_workdir
- store_artifacts: *artifact_test262_diff_tap
- run:
name: Output comparision results and report to CircleCI
command: |
mkdir -p ~/test-results/test262
cat ~/diff.tap | $(npm bin)/tap-mocha-reporter xunit | tee ~/test-results/test262/results.xml || true
<<: *test262_workdir
- store_test_results: *artifact_test262_xunit

workflows:
version: 2
test:
jobs:
- test
master:
jobs:
- test262:
filters:
branches:
only:
- master
- test262
# master:
# jobs:
# - test262:
# filters:
# branches:
# only:
# - master
# test262:
# jobs:
# - test262
# test262-after-approval:
# jobs:
# - approve-test262-run:
# type: approval
# - test262
# requires:
# - approve-test262-run

0 comments on commit d6a8c02

Please sign in to comment.