- name: Goldmane
  run:
    when: "${CHANGE_IN(goldmane)}"
  execution_time_limit:
    minutes: 30
  dependencies:
    - Prerequisites
  task:
    env_vars:
      - name: BUILD_CACHE_GROUP
        value: "goldmane"
    prologue:
      commands:
        # The Makefile sometimes tries to rebuild the protobuf files on non-amd architectures
        # even when they don't need to be. Touch the file to update the timestamp. We know
        # they will be up-to-date due to preflight checks.
        - touch goldmane/proto/api.pb.go
        - cd goldmane
    jobs:
      - name: "Goldmane: CI"
        commands:
          - ../.semaphore/run-and-monitor make-ci.log make ci
        env_vars:
          - name: STORE_BUILD_CACHE
            value: "true"
      - name: "Goldmane: build multi-arch"
        matrix:
          - env_var: ARCH
            values:
              - arm64
              - ppc64le
              - s390x
        commands:
          - ../.semaphore/run-and-monitor image-$ARCH.log make build ARCH=$ARCH
