Skip to content

Commit

Permalink
Merge pull request #19 from maxmind/greg/prepare-for-1.1.0
Browse files Browse the repository at this point in the history
Update CI build and prepare for 1.1.0
  • Loading branch information
mateu authored Oct 11, 2016
2 parents 2b91abc + d442b42 commit afbe537
Show file tree
Hide file tree
Showing 8 changed files with 376 additions and 73 deletions.
98 changes: 26 additions & 72 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,36 @@
---
language: generic

addons:
apt:
packages:
- gettext
- libcurl4-openssl-dev
- libicu-dev
- libssl-dev
- libunwind8
- zlib1g
language: csharp
solution: mono/MaxMind.MinFraud.sln

env:
global:
- MAXMIND_TEST_BASE_DIR=MaxMind.MinFraud.UnitTest
- CONFIGURATION=Release
- MAXMIND_TEST_BASE_DIR="$PWD/MaxMind.MinFraud.UnitTest"

matrix:
include:
- os: linux
dist: trusty # Ubuntu 14.04
sudo: required
env: CONFIGURATION=Debug
- os: linux
dist: trusty
sudo: required
env: CONFIGURATION=Release
- os: osx
osx_image: xcode7.2 # macOS 10.11
env: CONFIGURATION=Debug
- os: osx
osx_image: xcode7.2
env: CONFIGURATION=Release

before_install:
# Install OpenSSL
# Also set download URLs obtained from https://www.microsoft.com/net/download#core
- if test "$TRAVIS_OS_NAME" == "osx"; then
brew install openssl;
brew link --force openssl;
export DOTNET_SDK_URL="https://go.microsoft.com/fwlink/?LinkID=809128";
else
export DOTNET_SDK_URL="https://go.microsoft.com/fwlink/?LinkID=809129";
fi

- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli"

# Install .NET CLI
- mkdir $DOTNET_INSTALL_DIR
- curl -L $DOTNET_SDK_URL -o dotnet_package
- tar -xvzf dotnet_package -C $DOTNET_INSTALL_DIR

# Add dotnet to PATH
- export PATH="$DOTNET_INSTALL_DIR:$PATH"

# Update submodules
- git submodule update --init --recursive

install:
# Display dotnet version info
- which dotnet;
if [ $? -eq 0 ]; then
echo "Using dotnet:";
dotnet --info;
else
echo "dotnet.exe not found"
exit 1;
fi

# Restore Packages
- dotnet restore

# Build Projects
- dotnet build -c $CONFIGURATION -f netstandard1.4 ./MaxMind.MinFraud
- dotnet build -c $CONFIGURATION -f netcoreapp1.0 ./MaxMind.MinFraud.UnitTest

script:
# Run Unit Tests
- dotnet test -f netcoreapp1.0 -c $CONFIGURATION MaxMind.MinFraud.UnitTest
- os: linux
dist: trusty # Ubuntu 14.04
dotnet: 1.0.0-preview2-003121
mono: none
env: DOTNETCORE=1
sudo: required
# This is temporarily disabled. See discussion on
# https://github.com/maxmind/minfraud-api-dotnet/pull/19
# - os: osx
# osx_image: xcode7.3 # macOS 10.11
# dotnet: 1.0.0-preview2-003121
# mono: none
# env: DOTNETCORE=1
- os: linux
dist: trusty # Ubuntu 14.04
mono: latest
sudo: false
- os: osx
osx_image: xcode7.3 # macOS 10.11
mono: latest

script: ./dev-bin/build.sh

notifications:
email:
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ build_script:
echo "dotnet.exe not found"
exit 1
}
# Restore Packages
dotnet restore
# Build Projects
dotnet build -c $env:CONFIGURATION -f $env:FrameworkLibsMoniker .\MaxMind.MinFraud
dotnet build -c $env:CONFIGURATION -f $env:SECONDARYFRAMEWORK .\MaxMind.MinFraud.UnitTest
Expand Down
27 changes: 27 additions & 0 deletions dev-bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

cd `dirname $0`/..

if [ -n "$DOTNETCORE" ]; then

echo Using .NET CLI

dotnet restore

# Running Unit Tests
dotnet test -f netcoreapp1.0 -c $CONFIGURATION ./MaxMind.MinFraud.UnitTest

else

echo Using Mono

pushd mono

nuget restore

xbuild /p:Configuration=$CONFIGURATION

mono mono/packages/NUnit.ConsoleRunner.3.4.1/tools/nunit3-console.exe --where "cat != BreaksMono" ./mono/bin/$CONFIGURATION/MaxMind.MinFraud.UnitTest.dll

popd
fi
156 changes: 156 additions & 0 deletions mono/MaxMind.MinFraud.UnitTest.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B94CD151-77D9-4423-BB17-504264B109D2}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MaxMind.MinFraud.UnitTest</RootNamespace>
<AssemblyName>MaxMind.MinFraud.UnitTest</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="MaxMind.Db, Version=2.1.2.0, Culture=neutral, PublicKeyToken=66afa4cc5ae853ac, processorArchitecture=MSIL">
<HintPath>packages\MaxMind.Db.2.1.2\lib\net45\MaxMind.Db.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MaxMind.GeoIP2, Version=2.6.0.0, Culture=neutral, PublicKeyToken=66afa4cc5ae853ac, processorArchitecture=MSIL">
<HintPath>packages\MaxMind.GeoIP2.2.7.1\lib\net45\MaxMind.GeoIP2.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>packages\Newtonsoft.Json.9.0.1.0\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.4.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.0\lib\net45\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="RichardSzalay.MockHttp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=ed48272b5473f4a9, processorArchitecture=MSIL">
<HintPath>packages\MockHttpSigned.1.3.0-netstandard-alpha3\lib\net45\RichardSzalay.MockHttp.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Net" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions, Version=2.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.Primitives, Version=4.2.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http.WebRequest" />
</ItemGroup>
<Choose>
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
</ItemGroup>
</When>
<Otherwise />
</Choose>
<ItemGroup>
<Compile Include="..\MaxMind.MinFraud.UnitTest\Exception\HttpExceptionTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Exception\InvalidRequestExceptionTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\DeviceTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\EmailTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\GeoIP2CountryTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Properties\AssemblyInfo.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\AccountTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\BillingTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\CreditCardTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\DeviceTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\EmailTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\EventTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\MinFraudRequestTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\OrderTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\PaymentTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\ShippingTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\ShoppingCartItemTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Request\TestHelper.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\AddressTestHelper.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\BillingAddressTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\CreditCardTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\GeoIP2LocationTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\InsightsTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\IPAddressTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\IssuerTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\ScoreTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\ShippingAddressTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\SubscoresTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\Response\WarningTest.cs" />
<Compile Include="..\MaxMind.MinFraud.UnitTest\WebServiceClientTest.cs" />
</ItemGroup>
<ItemGroup>
<None Include="..\MaxMind.MinFraud.UnitTest\TestData\factors-response.json" />
<None Include="..\MaxMind.MinFraud.UnitTest\TestData\full-request.json" />
<None Include="..\MaxMind.MinFraud.UnitTest\TestData\insights-response.json" />
<None Include="..\MaxMind.MinFraud.UnitTest\TestData\score-response.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="MaxMind.MinFraud.csproj">
<Project>{7208D9C8-F862-4675-80E5-77A2F8901B96}</Project>
<Name>MaxMind.MinFraud</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Choose>
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
<ItemGroup>
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Private>False</Private>
</Reference>
</ItemGroup>
</When>
</Choose>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit afbe537

Please sign in to comment.