Add CircleCI (#2106)

Transfer Travis jobs to CircleCI
This commit is contained in:
Leo Balter 2019-03-20 21:04:41 -04:00 committed by GitHub
parent d5076e3e8e
commit ebbe13e2b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 169 additions and 78 deletions

153
.circleci/config.yml Normal file
View File

@ -0,0 +1,153 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
references:
js_deps_cache_key: &js_deps_cache_key
v1-dependency-js-deps-{{ checksum "package.json" }}
js_deps_backup_cache_key: &js_deps_backup_cache_key
v1-dependency-js-deps
node_latest: &node_latest
circleci/node:11
node_lts: &node_lts
circleci/node:10
restore_cache: &restore_cache
restore_cache:
keys:
- *js_deps_cache_key
- *js_deps_backup_cache_key
save_cache: &save_cache
save_cache:
paths:
- node_modules
key: *js_deps_cache_key
execution_steps_node: &execution_steps_node
steps:
- checkout
- *restore_cache
- run: npm install
- *save_cache
- run: npm test
execution_steps_jsvu: &execution_steps_jsvu
steps:
- checkout
- *restore_cache
- run: npm install
- *save_cache
- run: ./node_modules/.bin/jsvu --os=linux64 --engines=$hostName
- run: cp -r ~/.jsvu/engines/$hostName r
- run: npm test
jobs:
"Project lint, generation tests and build":
docker:
- image: circleci/python:2.7
working_directory: ~/test262
steps:
- checkout
- run:
name: "Install requirements for generation tool"
command: python -m pip install --user --requirement tools/generation/requirements.txt
- run:
name: "Install requirements for linter tool"
command: python -m pip install --user --requirement tools/lint/requirements.txt
- run:
name: "Test the generation tool"
command: ./tools/generation/test/run.py
- run:
name: "Test the lint tool"
command: ./tools/lint/test/run.py
- run:
name: "Re-generate files and check for new changes"
command: ./tools/scripts/ci_build.sh
- run:
name: "Run the linter"
command: ./tools/scripts/ci_lint.sh
# - run:
# name: "Run deploy"
# command: ./tools/scripts/deploy.sh
"V8: New or modified tests execution":
docker:
- image: *node_latest
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
working_directory: ~/test262
environment:
hostType: d8
hostPath: r/v8
hostName: v8
<<: [*execution_steps_jsvu]
"V8 --harmony: New or modified tests execution":
docker:
- image: *node_latest
working_directory: ~/test262
environment:
hostType: d8
hostPath: r/v8
hostName: v8
hostArgs: --harmony
<<: [*execution_steps_jsvu]
"SpiderMonkey: New or modified tests execution":
docker:
- image: *node_latest
working_directory: ~/test262
environment:
hostType: jsshell
hostPath: r/spidermonkey
hostName: spidermonkey
<<: [*execution_steps_jsvu]
"ChakraCore: New or modified tests execution":
docker:
- image: *node_latest
working_directory: ~/test262
environment:
hostType: ch
hostPath: r/chakra
hostName: chakra
<<: [*execution_steps_jsvu]
"JSC: New or modified tests execution":
docker:
- image: *node_latest
working_directory: ~/test262
environment:
hostType: jsc
hostPath: r/javascriptcore
hostName: javascriptcore
<<: [*execution_steps_jsvu]
"Node LTS: New or modified tests execution":
docker:
- image: *node_lts
working_directory: ~/test262
environment:
hostType: node
hostPath: node
<<: [*execution_steps_node]
"Node (latest): New or modified tests execution":
docker:
- image: *node_latest
working_directory: ~/test262
environment:
hostType: node
hostPath: node
<<: [*execution_steps_node]
workflows:
version: 2
Tools:
jobs:
- "Project lint, generation tests and build"
Tests execution:
jobs:
- "ChakraCore: New or modified tests execution"
- "JSC: New or modified tests execution"
- "SpiderMonkey: New or modified tests execution"
- "V8: New or modified tests execution"
- "V8 --harmony: New or modified tests execution"
- "Node LTS: New or modified tests execution"
- "Node (latest): New or modified tests execution"

View File

@ -1,55 +0,0 @@
matrix:
include:
- language: python
name: Project lint, generation tests and build
python:
- "2.7"
install:
- python -m pip install --requirement tools/generation/requirements.txt
- python -m pip install --requirement tools/lint/requirements.txt
script:
- ./tools/scripts/ci_build.sh
- ./tools/generation/test/run.py
- ./tools/lint/test/run.py
- ./tools/scripts/ci_lint.sh
after_success:
- ./tools/scripts/deploy.sh
- language: node_js
name: "New or modified tests on SpiderMonkey"
if: type = pull_request
node_js: "node"
script: ./tools/scripts/ci_test.sh
env: T262ENGINE=spidermonkey hostType=jsshell
- language: node_js
name: "New or modified tests on V8"
if: type = pull_request
node_js: "node"
script: ./tools/scripts/ci_test.sh
env: T262ENGINE=v8 hostType=d8
- language: node_js
name: "New or modified tests on V8 with --harmony"
if: type = pull_request
node_js: "node"
script: ./tools/scripts/ci_test.sh
env: T262ENGINE=v8 hostType=d8 hostArgs='--harmony'
- language: node_js
name: "New or modified tests on ChakraCore"
if: type = pull_request
node_js: "node"
script: ./tools/scripts/ci_test.sh
env: T262ENGINE=chakra hostType=ch
- language: node_js
name: "New or modified tests on JavaScriptCore"
if: type = pull_request
node_js: "node"
script: ./tools/scripts/ci_test.sh
env: T262ENGINE=javascriptcore hostType=jsc
- language: node_js
name: "New or modified tests on Node"
if: type = pull_request
node_js: "node"
script: ./tools/scripts/ci_test.sh
env: T262ENGINE=node hostType=node
notifications:
email:
on_failure: always

View File

@ -13,11 +13,10 @@
"private": true,
"homepage": "https://github.com/tc39/test262#readme",
"devDependencies": {
"jsvu": "^1.3.1",
"jsvu": "^1.6.1",
"test262-harness": "^4.7.0"
},
"scripts": {
"ci-jsvu": "jsvu --os=linux64 --engines=$T262ENGINE",
"ci-test-pr": "test262-harness --hostType=$HOSTTYPE --hostPath=~/.jsvu/$T262ENGINE --hostArgs=\"$HOSTARGS\" $(git diff --name-only --diff-filter=AMR master test/)"
"test": "./tools/scripts/ci_test.sh"
}
}

View File

@ -1,9 +1,9 @@
#!/bin/sh
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ "$CIRCLE_PULL_REQUEST" != "" ]; then
./make.py clean > /dev/null
fi
./make.py
if [ -n "$(git status --porcelain)" -a "$TRAVIS_PULL_REQUEST" != "false" ]; then
if [ -n "$(git status --porcelain)" -a "$CIRCLE_PULL_REQUEST" != "" ]; then
echo New changes were found after re-generating the tests.
echo Please, read the documentation on procedurally generated tests
echo 'https://github.com/tc39/test262/blob/master/CONTRIBUTING.md#procedurally-generated-tests'

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
paths=$(git diff --diff-filter ACMR --name-only $TRAVIS_BRANCH -- test/)
if [ "$CIRCLE_PULL_REQUEST" != "" ]; then
paths=$(git diff --diff-filter ACMR --name-only origin/master -- test/)
if [ "$paths" == "" ]; then
echo No test files added or modified. Exiting.

View File

@ -1,7 +1,7 @@
#!/bin/bash
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
paths=$(git diff --diff-filter ACMR --name-only $TRAVIS_BRANCH -- test/)
if [ "$CIRCLE_PULL_REQUEST" != "" ]; then
paths=$(git diff --diff-filter ACMR --name-only origin/master -- test/)
if [ "$paths" == "" ]; then
echo No test files added or modified. Exiting.
@ -12,19 +12,13 @@ if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo "$paths"
echo ""
if [ "$T262ENGINE" != "node" ]; then
echo "installing engine with jsvu"
echo "jsvu --os=linux64 --engines=$T262ENGINE"
jsvu --os=linux64 --engines=$T262ENGINE
hostPath=$HOME/.jsvu/$T262ENGINE
else
hostPath=node
echo "Running the tests with test262-harness"
test262-harness -t 1 --hostType=$hostType --hostPath=$hostPath --hostArgs="$hostArgs" -- $paths | tee exec.out
if grep -q '^[1-9][0-9]* failed$' exec.out; then
rm exec.out
exit 1
fi
echo ""
echo "Running the tests with test262-harness"
echo "test262-harness -t 1 --hostType=$hostType --hostPath=$hostPath --hostArgs=\"$hostArgs\" -- $paths"
test262-harness -t 1 --hostType=$hostType --hostPath=$hostPath --hostArgs="$hostArgs" -- $paths
rm exec.out
fi

View File

@ -1,5 +1,5 @@
#!/bin/sh
if [ $TRAVIS_EVENT_TYPE != "push" -o $TRAVIS_BRANCH != "master" ]; then
if [ $CIRCLE_EVENT_TYPE != "push" -o $CIRCLE_BRANCH != "master" ]; then
echo This job is not running against a commit that has been merged to master.
echo Skipping deployment.
exit 0