version: v1.0
name: Build

agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu1804
execution_time_limit:
  minutes: 15 # Default is 1 hour

blocks:
  - name: Setup
    task:
      prologue:
        commands:
          - sem-version php 7.2.10 # Be explicit, even when using the default (in case the default changes)
          - checkout
      jobs:
      - name: Composer install
        commands:
          - cache restore composer-$SEMAPHORE_GIT_BRANCH-$(checksum composer.lock),composer-$SEMAPHORE_GIT_BRANCH,composer-master
          - composer install --prefer-dist --no-suggest --no-interaction
          - cache store composer-$SEMAPHORE_GIT_BRANCH-$(checksum composer.lock) vendor
  - name: Tests
    task:
      prologue:
        commands:
          - sem-version php 7.2.10 # Be explicit, even when using the default (in case the default changes)
          - checkout
          - cache restore composer-$SEMAPHORE_GIT_BRANCH-$(checksum composer.lock),composer-$SEMAPHORE_GIT_BRANCH,composer-master
          - export "PATH=./vendor/bin:${PATH}" # Prepend vendor/bin to the path so we can use dependency executables
      jobs:
      - name: Tests
        commands:
          - php-cs-fixer fix --config=.php_cs --dry-run --diff -v # Too few files to restrict via CHANGED_FILES
          - phpunit --stop-on-failure

Switch lib to Semaphore 2.0 builds
Switch lib to Semaphore 2.0 builds
