SU-SWS/stanford_person

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
version: 2
# CircleCI integration with Drupal 8.

## Defines images and working directory.
defaults: &defaults
  docker:
    - image: pookmish/drupal8ci:latest
    - image: selenium/standalone-chrome:latest
    - image: circleci/mysql:5.7
      environment:
        MYSQL_DATABASE: drupal
        MYSQL_USER: drupal
        MYSQL_PASSWORD: drupal
        MYSQL_ALLOW_EMPTY_PASSWORD: 1
  working_directory: /var/www/html

back_to_dev: &back_to_dev
  <<: *defaults
  steps:
    - checkout
    - run:
        name: Back to dev
        command: |
          composer global require su-sws/stanford-caravan:dev-8.x-2.x
          ~/.composer/vendor/bin/sws-caravan back-to-dev ${CIRCLE_TAG} ${CIRCLE_WORKING_DIRECTORY}

d9_codeception: &d9_codeception
  <<: *defaults
  steps:
    - checkout:
        path: /var/www/test
    - run:
        name: Run Codeception Tests
        command: |
          composer global require su-sws/stanford-caravan:dev-8.x-2.x
          ~/.composer/vendor/bin/sws-caravan codeception /var/www/html --extension-dir=/var/www/test --suites=functional
    - store_test_results:
        path: /var/www/html/artifacts/behat
    - store_artifacts:
        path: /var/www/html/artifacts

# Declare all of the jobs we should run.
jobs:
  run-back-to-dev:
    <<: *back_to_dev
  run-d9-codeception:
    <<: *d9_codeception

# Declare a workflow that runs all of our jobs in parallel.
workflows:
  version: 2
  after_release:
    jobs:
      - run-back-to-dev:
          filters:
            tags:
              only:
                - /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*).*?$/
            branches:
              ignore:
                - /.*/
  tests:
    jobs:
      - run-d9-codeception:
          context: github-auth