version: v1.0
name: API
execution_time_limit:
  hours: 4

agent:
  machine:
    type: e1-standard-2
    os_image: ubuntu2004

auto_cancel:
  running:
    when: "branch != 'master'"
  queued:
    when: "branch != 'master'"

global_job_config:
  secrets:
    - name: docker-hub
  prologue:
    commands:
    - echo $DOCKERHUB_PASSWORD | docker login --username "$DOCKERHUB_USERNAME" --password-stdin
    - checkout 

blocks:
  - name: Run build and tests
    execution_time_limit:
      minutes: 30
    dependencies: []
    task:
      jobs:
        - name: "make build / ci"
          commands:
            - make build
            - make ci
