The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!/bin/bash

# https://buildkite.com/docs/guides/writing-build-scripts
set -eo pipefail

source ~/perl5/perlbrew/etc/bashrc

# due to the setup putting us in a detatched state we hit
# "fatal: Cannot lock the ref ..."
# a hack for this is to make a temporary branch, so we're no longer detatched
# (and nuke it when we're done)
git checkout -qf -b buildkite/${BUILDKITE_COMMIT}

# actually run the tests
dzil test

# we can't delete the branch we're on ... switch (back) to master
git checkout -qf master
git branch -D buildkite/${BUILDKITE_COMMIT}