diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..98053ed3c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,44 @@ +language: csharp + +#dotnet cli require Ubuntu 14.04 +sudo: required +dist: trusty + +#dotnet cli require OSX 10.10 +osx_image: xcode7.1 + +addons: + apt: + packages: + - gettext + - libcurl4-openssl-dev + - libicu-dev + - libssl-dev + - libunwind8 + - zlib1g + +os: + - osx + - linux + +env: + matrix: + - CLI_VERSION=Latest + +matrix: + allow_failures: + - env: CLI_VERSION=Latest + +before_install: + - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi + # Download script to install dotnet cli + - curl -L --create-dirs https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh -o ./scripts/obtain/install.sh + - find ./scripts -name "*.sh" -exec chmod +x {} \; + - export DOTNET_INSTALL_DIR="$PWD/.dotnetcli" + # use bash to workaround bug https://github.com/dotnet/cli/issues/1725 + - sudo bash ./scripts/obtain/install.sh --channel "preview" --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR" --no-path + # add dotnet to PATH + - export PATH="$DOTNET_INSTALL_DIR:$PATH" + +script: + - ./build.sh \ No newline at end of file diff --git a/build.sh b/build.sh index ef9dcc392..182b88a1f 100755 --- a/build.sh +++ b/build.sh @@ -1,14 +1,13 @@ #!/bin/bash - dotnet restore - -cd src/Serilog/ - -dotnet build -f netstandard1.0 -c Release -dotnet build -f netstandard1.3 -c Release - -cd ../.. -cd test/Serilog.Tests/ - -dotnet build -f netcoreapp1.0 -c Release -dotnet test -f netcoreapp1.0 -c Release \ No newline at end of file +for path in src/*/project.json; do + dirname="$(dirname "${path}")" + dotnet build ${dirname} -f netstandard1.0 -c Release + dotnet build ${dirname} -f netstandard1.3 -c Release +done + +for path in test/Serilog.Tests/project.json; do + dirname="$(dirname "${path}")" + dotnet build ${dirname} -f netcoreapp1.0 -c Release + dotnet test ${dirname} -f netcoreapp1.0 -c Release +done \ No newline at end of file