Skip to content
Snippets Groups Projects
config.yml 8.14 KiB
# Copyright 2019 PrivateStorage.io, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version: 2.1

aliases:
  - &PREPARE_VIRTUALENV
    run:
      name: "Prepare virtualenv"
      command: |
        virtualenv venv
        . venv/bin/activate
        pip install --upgrade certifi pip
        pip install ${PIP_REQUIREMENTS}

jobs:
  documentation:
    docker:
      - image: "circleci/python:3.7"

    environment:
      PIP_REQUIREMENTS: "-r docs/requirements.txt"

    steps:
      - "checkout"

      - <<: *PREPARE_VIRTUALENV

      - run:
          name: "Sphinx Documentation Build"
          command: |
            . venv/bin/activate
            sphinx-build docs/source docs/build

      - store_artifacts:
          path: "docs/build"
          destination: "docs"

  macos-tests:
    parameters:
      py-version:
        type: "string"
      xcode-version:
        type: "string"

    macos:
      xcode: << parameters.xcode-version >>

    steps:
      - "checkout"

      - restore_cache:
          keys:
          # when setup.cfg changes, use increasingly general patterns to
          # restore cache
          - pip-packages-v1-{{ .Branch }}-{{ checksum "setup.cfg" }}
          - pip-packages-v1-{{ .Branch }}-
          - pip-packages-v1-