From d6a8c02207236681fa4bb6c8e6cdfb54ccc84268 Mon Sep 17 00:00:00 2001 From: jbhoosreddy Date: Sat, 19 Oct 2019 04:26:19 -0400 Subject: [PATCH] Implement PR workflow with test262 --- .circleci/config.yml | 56 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 691613f6de4b..ff0ddbb580a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,6 +39,9 @@ aliases: - &artifact_test262_xunit path: ~/test-results + - &artifact_test262_diff_tap + path: ~/diff.tap + jobs: test: working_directory: ~/babel @@ -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: @@ -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 @@ -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