reitit/.circleci/config.yml

109 lines
3 KiB
YAML
Raw Normal View History

version: 2
jobs:
2018-03-13 12:40:38 +00:00
test-clj:
working_directory: ~/test
docker:
- image: clojure:lein-2.7.1
steps:
- checkout
- restore_cache:
keys:
2018-03-13 12:40:38 +00:00
- 'v1-clj-{{ checksum "project.clj" }}'
- 'v1-clj-'
- 'v1-test-'
2017-10-28 10:21:35 +00:00
- run:
name: Install modules
command: ./scripts/lein-modules install
- run:
name: Run tests
command: ./scripts/test.sh clj
- store_test_results:
2018-03-10 10:32:16 +00:00
# path must be a directory under which there a subdirectories that
# contain the JUnit XML files.
path: ~/test/target/results
2017-12-28 08:48:18 +00:00
# - run:
# name: Run coverage
# command: ./scripts/submit-to-coveralls.sh clj
- save_cache:
2018-03-13 12:40:38 +00:00
key: 'v1-clj-{{ checksum "project.clj" }}'
paths:
- ~/.m2
2018-03-13 12:40:38 +00:00
test-cljs:
working_directory: ~/test
docker:
- image: circleci/clojure:lein-2.8.1-node-browsers
steps:
- checkout
- restore_cache:
keys:
- 'v1-cljs-{{ checksum "project.clj" }}-{{ checksum "package.json" }}'
- 'v1-cljs-'
- run:
name: Install npm dependencies
command: npm install
- run:
name: Install modules
command: ./scripts/lein-modules install
- run:
name: Run tests
command: ./scripts/test.sh cljs
- store_test_results:
path: ~/test/target/results
- save_cache:
key: 'v1-cljs-{{ checksum "project.clj" }}-{{ checksum "package.json" }}'
paths:
- ~/.m2
- ~/test/node_modules
build-docs:
working_directory: ~/build
docker:
- image: circleci/node:latest
steps:
- checkout
2017-10-25 15:00:09 +00:00
- run: rm package.json package-lock.json
- restore_cache:
keys:
- 'v1-gitbook-{{ checksum "book.json" }}'
- 'v1-gitbook-'
- run:
name: "Install GitBook"
2017-10-25 15:00:09 +00:00
command: npm install gitbook-cli && ./node_modules/.bin/gitbook install
- run:
name: "Clone gh-pages"
command: git clone --branch gh-pages git@github.com:metosin/reitit.git ~/gh-pages
- run:
name: Build the documentation
command: |
./node_modules/.bin/gitbook build
cp -r _book/* ~/gh-pages/
- add_ssh_keys:
fingerprints:
- "2d:eb:be:af:53:33:36:01:40:61:81:9d:76:84:8e:83"
- deploy:
name: Upload the documentation
command: |
cd ~/gh-pages
git config user.name "Automatic build"
git config user.email "noreply@metosin.fi"
git add -A
2017-09-22 08:22:15 +00:00
git commit -m "Build book from commit $CIRCLE_SHA1 [skip ci]"
git push
- save_cache:
key: 'v1-gitbook-{{ checksum "book.json" }}'
paths:
- node_modules
workflows:
version: 2
test-and-build-docs:
jobs:
2018-03-13 12:40:38 +00:00
- test-clj
- test-cljs
2017-10-25 14:58:18 +00:00
- build-docs:
filters:
branches:
only:
- master