2019-01-06 05:52:53 -08:00
|
|
|
# TODO should I use yarn as in circleci node example??
|
2019-01-06 05:47:50 -08:00
|
|
|
version: 2
|
2019-06-29 06:44:54 -07:00
|
|
|
|
2019-01-06 05:47:50 -08:00
|
|
|
jobs:
|
2019-06-29 06:44:54 -07:00
|
|
|
client_build_and_check:
|
2019-01-06 05:47:50 -08:00
|
|
|
docker:
|
|
|
|
- image: circleci/node:latest
|
|
|
|
steps:
|
|
|
|
- checkout
|
2019-12-09 13:03:33 -08:00
|
|
|
- run: sudo npm install -g npm web-ext
|
2019-01-06 05:52:53 -08:00
|
|
|
|
2019-01-06 05:47:50 -08:00
|
|
|
- restore_cache:
|
2019-01-06 05:52:53 -08:00
|
|
|
keys:
|
|
|
|
- dependency-cache-{{ checksum "package.json" }}
|
|
|
|
# fallback to using the latest cache if no exact match is found
|
|
|
|
- dependency-cache-
|
2019-01-06 05:47:50 -08:00
|
|
|
- run: npm install
|
|
|
|
- save_cache:
|
|
|
|
key: dependency-cache-{{ checksum "package.json" }}
|
|
|
|
paths:
|
|
|
|
- ./node_modules
|
2019-06-29 06:44:54 -07:00
|
|
|
|
2019-12-09 13:03:33 -08:00
|
|
|
- run: ./build --chrome --lint
|
2019-06-29 06:44:54 -07:00
|
|
|
|
|
|
|
# TODO ugh. is there a way for a job to inherit a cloned repo after npm run build has ran?? I'd like to separate build and check steps
|
2019-06-29 07:45:54 -07:00
|
|
|
# TODO ok, apparently it's a custom executor? https://circleci.com/docs/2.0/workflows/#using-workspaces-to-share-data-among-jobs
|
2019-01-06 05:47:50 -08:00
|
|
|
- run:
|
2019-06-29 06:44:54 -07:00
|
|
|
name: js flow
|
2019-01-06 05:47:50 -08:00
|
|
|
command: npm run flow
|
2019-06-29 06:44:54 -07:00
|
|
|
when: always
|
2019-01-06 12:49:39 -08:00
|
|
|
- run:
|
|
|
|
name: eslint
|
|
|
|
command: npm run eslint
|
2019-06-29 06:44:54 -07:00
|
|
|
when: always
|
|
|
|
|
2019-06-29 07:45:54 -07:00
|
|
|
- run:
|
|
|
|
# TODO need to do some kind of build matrix over [firefox, chrome] x [anyhost, no_anyhost]
|
|
|
|
# it should be somehow achievable via workspaces, but I've spent 10 minutes and couldn't figure it out...
|
|
|
|
name: pack
|
|
|
|
command: |
|
|
|
|
|
|
|
|
for browser in 'chrome'; do
|
2019-12-09 13:03:33 -08:00
|
|
|
zip -r -j "/tmp/grasp.zip" dist/*
|
2019-06-29 07:45:54 -07:00
|
|
|
done
|
|
|
|
|
|
|
|
# TODO ugh, also can't use env variables in artifacts...
|
|
|
|
- store_artifacts:
|
|
|
|
path: "/tmp/grasp.zip"
|
|
|
|
destination: "grasp.zip"
|
|
|
|
|
2019-06-29 06:44:54 -07:00
|
|
|
|
|
|
|
server_build_and_check:
|
|
|
|
docker:
|
|
|
|
- image: circleci/python:latest
|
|
|
|
steps:
|
|
|
|
- checkout
|
|
|
|
|
|
|
|
# TODO preserve apt cache..
|
|
|
|
- run: sudo apt install python3-pip
|
|
|
|
- run: python3 -m pip install --user mypy pylint pytest
|
2019-06-29 09:37:31 -07:00
|
|
|
|
|
|
|
# test only dependencies
|
|
|
|
- run: sudo apt install httpie
|
|
|
|
- run: python3 -m pip install --user selenium pyautogui
|
|
|
|
#
|
2019-06-29 06:44:54 -07:00
|
|
|
|
|
|
|
- run:
|
|
|
|
name: pylint
|
|
|
|
command: ci/pylint
|
|
|
|
when: always
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: mypy
|
|
|
|
command: ci/mypy
|
|
|
|
when: always
|
|
|
|
|
|
|
|
- run:
|
|
|
|
name: pytest
|
|
|
|
command: ci/pytest
|
|
|
|
when: always
|
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
|
|
|
|
|
|
|
build_and_test:
|
|
|
|
jobs:
|
|
|
|
- client_build_and_check
|
|
|
|
- server_build_and_check
|
|
|
|
|
|
|
|
|
|
|
|
# # ugh. circleci only got python3.6 on this node package??? and it's unclear how to combine multiple circleci docker configurations...
|
|
|
|
|
|
|
|
# # - store_artifacts:
|
|
|
|
# # path: test-results.xml
|
|
|
|
# # prefix: tests
|
|
|
|
# # - store_artifacts:
|
|
|
|
# # path: coverage
|
|
|
|
# # prefix: coverage
|
|
|
|
# # - store_test_results:
|
|
|
|
# # path: test-results.xml
|