#/
# @license Apache-2.0
#
# Copyright (c) 2017 The Stdlib Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#/

# Customize the test machine:
machine:

  # Environment variables for all build commands:
  environment:
    NODE_PATH: "$HOME/$CIRCLE_PROJECT_REPONAME/lib/node_modules"

  # Version of Node.js to use:
  node:
    version: 12


# Customize the environment after repository checkout:
checkout:
  post:
    - 'git init'

    # Monitor process resource usage:
    - 'chmod +x ./tools/ci/circle/process_metrics && ./tools/ci/circle/process_metrics':
        background: true

    # Monitor system resource usage:
    - 'chmod +x ./tools/ci/circle/system_metrics && ./tools/ci/circle/system_metrics':
        background: true


# Custom environment dependencies:
dependencies:
  override:
    - 'nvm install node && nvm use node && npm update -g npm'
    - 'make --version'
    - 'gcc --version'
    - 'gfortran --version'
    - 'git --version'
    - 'node --version'
    - 'npm --version'


# Custom test commands:
test:
  override:
    - 'chmod +x ./tools/ci/circle/script && ./tools/ci/circle/script':
        parallel: true
  post:
    - 'chmod +x ./tools/ci/circle/after_script && ./tools/ci/circle/after_script':
        parallel: true
