Files
KaTeX/.circleci/config.yml
ylemkimon 295d933845 Enable greenkeeper-lockfile (#1531)
* Enable `greenkeeper-lockfile`

* Change colon to dash

* Fix command path

* Add SSH key
2018-08-12 23:55:19 -04:00

121 lines
3.0 KiB
YAML

checkout_submodule: &checkout_submodule
run:
name: Checkout submodule
command: |
git submodule sync
git submodule update --init --recursive
node_modules_cache_key: &node_modules_cache_key
yarn-deps-v1-{{ checksum "yarn.lock" }}
restore_node_modules_cache: &restore_node_modules_cache
restore_cache:
keys:
- *node_modules_cache_key
- yarn-deps-v1-
yarn_install: &yarn_install
run:
name: Install dependencies
command: yarn
screenshotter: &screenshotter
steps:
- checkout
- *checkout_submodule
- *restore_node_modules_cache
- *yarn_install
- run:
name: Verify screenshots and generate diffs and new screenshots
command: node dockers/screenshotter/screenshotter.js --selenium-ip localhost -b $CIRCLE_JOB --verify --diff --new
- store_artifacts:
path: test/screenshotter/new
destination: new
- store_artifacts:
path: test/screenshotter/diff
destination: diff
version: 2
jobs:
test:
docker:
- image: circleci/node:6
steps:
- run:
name: Check whether the build is running on the main repository
command: |
if [[ $CIRCLE_PULL_REQUEST && $CIRCLE_PROJECT_USERNAME != "Khan" ]]; then
echo "Please disable CircleCI on your forked repository!"
exit 1
fi
- checkout
- *checkout_submodule
- *restore_node_modules_cache
- *yarn_install
- save_cache:
key: *node_modules_cache_key
paths:
- node_modules
- add_ssh_keys:
fingerprints:
- "e1:ac:13:98:98:8b:fd:38:81:12:28:55:75:a1:da:73"
- run:
name: Test SSH key
command: |
if [[ $CIRCLE_BRANCH == "master" ]]; then
ssh -T git@github.com
fi
- run:
name: Greenkeeper - update and commit yarn.lock
command: |
./node_modules/.bin/greenkeeper-lockfile-update
./node_modules/.bin/greenkeeper-lockfile-upload
- run:
name: Run tests
command: yarn test --coverage
- run:
name: Upload code coverage reports to Codecov
command: ./node_modules/.bin/codecov
- run:
name: Build KaTeX
command: yarn build
- store_artifacts:
path: dist/katex.min.js
destination: katex.min.js
- store_artifacts:
path: dist/katex.min.css
destination: katex.min.css
- store_artifacts:
path: dist/fonts
destination: fonts
firefox:
docker:
- image: circleci/node:6
- image: selenium/standalone-firefox:2.48.2
<<: *screenshotter
chrome:
docker:
- image: circleci/node:6
- image: selenium/standalone-chrome:2.48.2
environment:
DBUS_SESSION_BUS_ADDRESS: /dev/null
<<: *screenshotter
workflows:
version: 2
test:
jobs:
- test
- firefox
- chrome