# Initialize gcloud via CLI
# $ gcloud init
#
# Steps (1, 2, 3, and 4 run simultaneously):
# ==========================================
# 1. Install npm packages for functions
# 2. Install npm packages for web-ng 
#      |
#      |
#      3. Run lint checks
#      4. Run unit tests

steps:

  # Install node packages for functions
  - name: 'gcr.io/cloud-builders/npm'
    id: 'Install npm packages for functions'
    waitFor: ['-']
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd functions && npm install

  # Install node packages for web-ng
  - name: 'gcr.io/cloud-builders/npm'
    id: &install_web_ng 'Install npm packages for web-ng'
    waitFor: ['-']
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd web-ng && npm install

  # Run eslint for web-ng
  - name: 'gcr.io/cloud-builders/npm'
    id: 'Run lint checks for web-ng'
    waitFor: [*install_web_ng]
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd web-ng && npm run check

  # Run tests for web-ng
  - name: 'gcr.io/cloud-builders/npm'
    id: 'Run tests for web-ng'
    waitFor: [*install_web_ng]
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd web-ng && npm run test

# Initialize gcloud via CLI
# $ gcloud init
#
# Steps (1, 2, 3, and 4 run simultaneously):
# ==========================================
# 1. Install npm packages for functions
# 2. Install npm packages for web-ng 
#      |
#      |
#      3. Run lint checks
#      4. Run unit tests

steps:

  # Install node packages for functions
  - name: node:12
    id: 'Install npm packages for functions'
    waitFor: ['-']
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd functions && npm install

  # Install node packages for web-ng
  - name: node:12
    id: &install_web_ng 'Install npm packages for web-ng'
    waitFor: ['-']
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd web-ng && npm install

  # Run eslint for web-ng
  - name: node:12
    id: 'Run lint checks for web-ng'
    waitFor: [*install_web_ng]
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd web-ng && npm run check

  # Run tests for web-ng
  - name: node:12
    id: 'Run tests for web-ng'
    waitFor: [*install_web_ng]
    entrypoint: 'bash'
    args:
     - '-c'
     - |
       cd web-ng && npm run test

Use newer nodejs dist in GCB
Use newer nodejs dist in GCB
