defaults_go: &DEFAULTS_GO
  language: go
  go: "1.9.2"
  cache:
    directories:
      - vendor

defaults_js: &DEFAULTS_JS
  language: node_js
  node_js: "8"
  # install defaults to "npm install", which is done via make
  install: []
  cache:
    directories:
      - node_modules

jobs:
  include:
    - stage: Lint docs
      <<: *DEFAULTS_JS
      script: make lint-docs

    - stage: Test Go code
      <<: *DEFAULTS_GO
      before_script:
        - make mock-assets
      script: make test-go

    - stage: Test JavaScript code
      <<: *DEFAULTS_JS
      env:
        - NODE_ENV=test
      script: make test-js

    - stage: Lint Go code
      <<: *DEFAULTS_GO
      script: make lint-go

    - stage: Lint JavaScript code
      <<: *DEFAULTS_JS
      script: make lint-js

    - stage: Build Docker image
      language: generic
      sudo: true
      addons:
        apt:
          packages:
            - docker-ce
      script: make docker-image

defaults_go: &DEFAULTS_GO
  language: go
  go: "1.9.2"
  cache:
    directories:
      - vendor

defaults_js: &DEFAULTS_JS
  language: node_js
  node_js: "8"
  # install defaults to "npm install", which is done via make
  install: []
  cache:
    directories:
      - node_modules

jobs:
  include:
    - stage: Test Go code
      <<: *DEFAULTS_GO
      before_script:
        - make mock-assets
      script: make test-go

    - stage: Test JavaScript code
      <<: *DEFAULTS_JS
      env:
        - NODE_ENV=test
      script: make test-js

    - stage: Lint Go code
      <<: *DEFAULTS_GO
      script: make lint-go

    - stage: Lint JavaScript code
      <<: *DEFAULTS_JS
      script: make lint-js

    - stage: Lint docs
      <<: *DEFAULTS_JS
      script: make lint-docs

    - stage: Build Docker image
      language: generic
      sudo: true
      addons:
        apt:
          packages:
            - docker-ce
      script: make docker-image

Move lint docs stage closer to other lint stages
Move lint docs stage closer to other lint stages
