version: 2 workflows: version: 2 build-analyze-run: jobs: - setup - build: requires: - setup - checks: requires: - build - docs: requires: - build - analyze: requires: - build - release: requires: - build defaults: &defaults docker: - image: offical2600hz/circleci:19.3.6.13 working_directory: ~/2600hz/kazoo shell: /bin/bash --login environment: BASH_ENV: ".git/.bashrc" jobs: setup: <<: *defaults steps: - checkout - run: make changed - persist_to_workspace: root: . paths: - . build: <<: *defaults steps: - attach_workspace: at: . - restore_cache: keys: - deps-v3-{{ checksum "make/deps.mk" }} - run: make fmt - run: | deps_hash=$(md5sum make/deps.mk | cut -d" " -f1) if [ x"$(cat .git/.kz_deps_hash)" = x"$deps_hash" ]; then touch "make/.deps.mk.$deps_hash" fi - run: JOBS="2" make - run: echo -n $(md5sum make/deps.mk | cut -d" " -f1) > .git/.kz_deps_hash - save_cache: key: deps-v3-{{ checksum "make/deps.mk" }} paths: - deps/ - .git/.kz_deps_hash - persist_to_workspace: root: . paths: - . checks: <<: *defaults steps: - attach_workspace: at: . - run: make code_checks - run: make app_applications - run: make xref - run: make sup_completion - run: make elvis - run: ${PWD}/scripts/check-unstaged.bash docs: <<: *defaults steps: - attach_workspace: at: . - run: make apis - run: make validate-js - run: make validate-schemas - run: make docs - run: ./scripts/state-of-docs.sh || true - run: ./scripts/state-of-edoc.escript - run: ${PWD}/scripts/check-unstaged.bash analyze: <<: *defaults steps: - attach_workspace: at: . - restore_cache: keys: - plt-v2-{{ checksum "make/deps.mk" }} - run: make build-plt dialyze-changed - save_cache: key: plt-v2-{{ checksum "make/deps.mk" }} paths: - .kazoo.plt release: <<: *defaults docker: - image: offical2600hz/circleci:19.3.6.13 - image: couchdb:2.1.1 - image: rabbitmq:3.7 environment: CIRCLE_ARTIFACTS: /tmp/circleci-artifacts TZ: "/usr/share/zoneinfo/UTC" steps: - attach_workspace: at: . - run: mkdir -p $CIRCLE_ARTIFACTS - run: make build-ci-release - run: KAZOO_CONFIG=${PWD}/rel/ci.config.ini REL="kazoo_apps" ACT="console" NODE_NAME_TYPE="-sname" make release - run: cp ${PWD}/rel/ci.relx.config $CIRCLE_ARTIFACTS/ - run: find ${PWD}/_rel/kazoo/releases -name kazoo.rel -exec cp {} $CIRCLE_ARTIFACTS/ \; - store_artifacts: path: /tmp/circleci-artifacts - run: | if [[ $(grep -c -v -F 'exit with reason shutdown' ${CIRCLE_ARTIFACTS}/log/error.log) -gt 0 ]]; then cat ${CIRCLE_ARTIFACTS}/log/error.log exit 1 fi