matrix:
  platform:
  - ubuntu2004
  - macos
tasks:
  verify_targets:
    name: Verify build targets
    platform: ${{ platform }}
    environment:
      ERLANG_VERSION: "24.3"
    shell_commands:
    - curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
    - chmod a+x kerl
    - ./kerl update releases
    - ./kerl build ${ERLANG_VERSION}
    - ./kerl install ${ERLANG_VERSION} ~/kerl/${ERLANG_VERSION}
    - |
        ERLANG_HOME="$(realpath ~/kerl/${ERLANG_VERSION})"
        cat << EOF >> user.bazelrc
          build --//:erlang_version=${ERLANG_VERSION}
          build --//:erlang_home=${ERLANG_HOME}
        EOF
    build_targets:
    - '//...'
