# This buildspec will run unit tests on the server code.

version: 0.2

env:
  shell: bash

phases:

  install:
    on-failure: ABORT
    runtime-versions:
      java: corretto11
    commands:
      - set -o pipefail
      - source ci/common/extra-env.sh
      - mkdir -pv ci/logs
      - source ci/1-server-scripts/1-install.sh
    finally:
      - source ci/common/upload-logs.sh

  build:
    on-failure: ABORT
    commands:
      - set -o pipefail
      - source ci/common/extra-env.sh
      - mkdir -pv ci/logs
      - source ci/1-server-scripts/3-build.sh
    finally:
      - source ci/common/upload-logs.sh

cache:
  paths:
    - '/root/.m2/**/*'  # Server dependencies.
    - '/var/lib/docker'
