Files
KaTeX/.circleci/config.yml
2018-08-10 19:29:16 +09:00

104 lines
2.4 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
- 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
<<: *screenshotter
workflows:
version: 2
screenshotter:
jobs:
- test
- firefox
- chrome