Files
atst/.circleci/config.yml
dandds b7b07ce89c Simpler CircleCI config for CI.
This relies on a CircleCI-supplied base image and removes CD for now.
2019-06-10 10:48:59 -04:00

107 lines
3.0 KiB
YAML

version: 2.0
defaults:
appEnvironment: &appEnvironment
KEEP_EXISTING_VENV: true
PGHOST: localhost
PGUSER: root
PGDATABASE: circle_test
REDIS_URI: redis://localhost:6379
PIP_VERSION: 18.*
CRL_STORAGE_PROVIDER: CLOUDFILES
jobs:
app_setup:
docker:
- image: circleci/python:3.6.6-stretch-node
environment: *appEnvironment
- image: circleci/postgres:9.6.5-alpine-ram
- image: circleci/redis:4-alpine3.8
steps:
- checkout
- run: sudo apt-get update
- run: sudo apt-get install postgresql-client-9.6
- run:
name: "Clone Submodules"
command: |
git submodule update --init --recursive
- attach_workspace:
at: .
- restore_cache:
name: "Load Cache: Pipenv References"
keys:
- pipenv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- pipenv-v1-{{ .Branch }}-
- pipenv-v1-
- restore_cache:
name: "Load Cache: Python Venv"
keys:
- venv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- venv-v1-{{ .Branch }}-
- venv-v1-
- restore_cache:
name: "Load Cache: Yarn"
keys:
- yarn-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-v1-{{ .Branch }}-
- yarn-v1-
- restore_cache:
name: "Load Cache: Node Modules"
keys:
- node-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run: ./script/setup
- save_cache:
name: "Save Cache: Pipenv Refrences"
paths:
- ~/.local/share
key: pipenv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- save_cache:
name: "Save Cache: Python Venv"
paths:
- ./.venv
key: venv-v1-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- save_cache:
name: "Save Cache: Yarn"
paths:
- ~/.cache/yarn
key: yarn-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- save_cache:
name: "Save Cache: Node Modules"
paths:
- ./node_modules
key: node-v1-{{ .Branch }}-{{ checksum "yarn.lock" }}
- run:
name: "Update CRLs"
command: ./script/sync-crls
- run:
name: "Generate build info"
command: ./script/generate_build_info.sh
- persist_to_workspace:
root: .
paths:
- .
test:
docker:
- image: circleci/python:3.6.6-stretch-node
environment: *appEnvironment
- image: circleci/postgres:9.6.5-alpine-ram
- image: circleci/redis:4-alpine3.8
steps:
- attach_workspace:
at: .
- run: sudo apt-get update
- run: sudo apt-get install postgresql-client-9.6
- run:
name: "Run Tests"
command: ./script/cibuild
workflows:
version: 2
run-tests:
jobs:
- app_setup
- test:
requires:
- app_setup