Skip to content

Commit 91fb64b

Browse files
committed
add travis ci
1 parent a6a0e0e commit 91fb64b

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

JsonApiDotNetCore/.travis.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
language: csharp
2+
sudo: required
3+
dist: trusty
4+
env:
5+
- CLI_VERSION=latest
6+
addons:
7+
apt:
8+
packages:
9+
- gettext
10+
- libcurl4-openssl-dev
11+
- libicu-dev
12+
- libssl-dev
13+
- libunwind8
14+
- zlib1g
15+
mono:
16+
- 4.2.3
17+
os:
18+
- linux
19+
- osx
20+
osx_image: xcode7.1
21+
branches:
22+
only:
23+
- master
24+
before_install:
25+
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fiopenssl; fi
26+
install:
27+
- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"
28+
- curl -sSL https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh | bash /dev/stdin --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR"
29+
- export PATH="$DOTNET_INSTALL_DIR:$PATH"
30+
script:
31+
- ./build.sh

build.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env bash
2+
3+
#exit if any command fails
4+
set -e
5+
6+
artifactsFolder="./artifacts"
7+
8+
if [ -d $artifactsFolder ]; then
9+
rm -R $artifactsFolder
10+
fi
11+
12+
dotnet restore
13+
14+
# Ideally we would use the 'dotnet test' command to test netcoreapp and net451 so restrict for now
15+
# but this currently doesn't work due to https://github.com/dotnet/cli/issues/3073 so restrict to netcoreapp
16+
17+
dotnet test ./JsonApiDotNetCoreTests -c Release -f netcoreapp1.0
18+
19+
# Instead, run directly with mono for the full .net version
20+
dotnet build ./JsonApiDotNetCoreTests -c Release -f net451
21+
22+
mono \
23+
./test/JsonApiDotNetCoreTests/bin/Release/net451/*/dotnet-test-xunit.exe \
24+
./test/JsonApiDotNetCoreTests/bin/Release/net451/*/JsonApiDotNetCoreTests.dll
25+
26+
revision=${TRAVIS_JOB_ID:=1}
27+
revision=$(printf "%04d" $revision)
28+
29+
dotnet pack ./JsonApiDotNetCore -c Release -o ./artifacts --version-suffix=$revision

0 commit comments

Comments
 (0)