diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a2fa7d0 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,20 @@ +version: 2 +jobs: + build: + working_directory: /circleci-matrix + docker: + - image: docker.io/library/alpine:3.5 + steps: + - checkout + - run: + name: Install dependencies + command: | + apk add --no-cache bash ca-certificates ncurses wget + wget -O bats-0.4.0.tar.gz https://github.com/sstephenson/bats/archive/v0.4.0.tar.gz + tar -xzf bats-0.4.0.tar.gz + cd bats-0.4.0 + ./install.sh /usr/local + - run: + name: Run tests + command: bats tests/run.bats + diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 11bad88..0000000 --- a/circle.yml +++ /dev/null @@ -1,13 +0,0 @@ -machine: - environment: - XCODE_SCHEME: ignoreMe - XCODE_WORKSPACE: ignoreMe - -dependencies: - override: - - brew install bats - -test: - override: - - bats tests/run.bats - - bats tests/installer.bats diff --git a/src/circleci-matrix.sh b/src/circleci-matrix.sh index 6c8e6f8..617856f 100755 --- a/src/circleci-matrix.sh +++ b/src/circleci-matrix.sh @@ -11,6 +11,10 @@ TERMINAL_COLUMNS=$(tput cols || true) export CIRCLE_NODE_TOTAL=${CIRCLE_NODE_TOTAL:-1} export CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX:-0} +if ! rm $(mktemp -t) ; then + MKTEMP_T_ARG=circleci_matrix.XXX +fi + error() { local message=$1 echo >&2 "ERROR: $message" @@ -182,7 +186,7 @@ read_file() { process_commands() { local line="" local envfile=$1 - local tempfile=$(mktemp -t circleci_matrix.XXX) + local tempfile=$(mktemp -t ${MKTEMP_T_ARG}) while read -r line; do cp -f "$envfile" "$tempfile" @@ -207,7 +211,7 @@ process_commands() { process_envs() { local line="" local i=0 - local tempfile=$(mktemp -t circleci_matrix.XXX) + local tempfile=$(mktemp -t ${MKTEMP_T_ARG}) local sources_prefix="$(sources)" while read -r line; do