pipelines:
  default:
    - step:
        name: Composer Install
        image: php:7.3
        caches:
          - composer
        script:
          - apt-get update && apt-get install -y unzip
          - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
          - composer install
    - step:
        name: Build
        image: node:8.6
        caches:
          - node
          - yarncustom
        script:
          - npm install
          - npm test
          - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.3.2
          - export PATH=$HOME/.yarn/bin:$PATH
          - yarn
          - yarn build:production # Ensures we have the right dependencies in main.scss etc
        artifacts:
          - dist/**
definitions:
  caches:
    yarncustom: /usr/local/share/.cache/yarn/v1
