Ver código fonte

Add Travis config

tags/v0.4.0
Silke 1 ano atrás
pai
commit
bcbf097c7c
2 arquivos alterados com 61 adições e 14 exclusões
  1. +39
    -0
      .travis.yml
  2. +22
    -14
      test.sh

+ 39
- 0
.travis.yml Ver arquivo

@@ -0,0 +1,39 @@
language: bash

stages:
- lint
- test

services:
- docker

env:
- VERBOSE=true

jobs:
include:
- stage: lint
name: shellcheck
script:
- shellcheck --version
- shellcheck **/*.sh

- stage: test
name: bash latest
env:
- IMAGE=bash:latest
script: &bash
- docker pull "$IMAGE"
- docker run -v "$PWD:/mnt" "$IMAGE" /mnt/test.sh

- stage: test
name: bash 5
env:
- IMAGE=bash:5
script: *bash

- stage: test
name: bash 4
env:
- IMAGE=bash:4
script: *bash

+ 22
- 14
test.sh Ver arquivo

@@ -90,25 +90,33 @@ _RELOAD_CONFIG() {
fi
}

# Run the tests in the tests folder
for test in tests/*.sh; do
_RELOAD_CONFIG
# shellcheck source=/dev/null
source "${test}"
done

# Run the tests for API versions
for version in {1..1}; do
echo "=> API version ${version}"
for test in tests/v${version}/*.sh; do
_RELOAD_CONFIG "${version}"
# Run all tests
if [ $# -eq 0 ]; then
# Run the tests in the tests folder
for test in tests/*.sh; do
_RELOAD_CONFIG
# shellcheck source=/dev/null
source "${test}"
done
done

# Run the tests for API versions
for version in {1..1}; do
echo "=> API version ${version}"
for test in tests/v${version}/*.sh; do
_RELOAD_CONFIG "${version}"
# shellcheck source=/dev/null
source "${test}"
done
done
else
# Run the given tests
for test in "$@"; do
_RELOAD_CONFIG
# shellcheck source=/dev/null
source "${test}"
done
fi

echo "Tests complete: ${FAILURES} failures."

exit ${FAILURES}


Carregando…
Cancelar
Salvar