forked from optimizely/csharp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
115 lines (106 loc) · 5.37 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
language: minimal
env:
global:
RELEASE_BRANCH: "master"
# Integration tests need to run first to reset the PR build status to pending
stages:
- name: 'Source Clear'
- name: 'Lint markdown files'
- name: 'Integration tests'
- name: 'Production tests'
- name: 'Unit Tests'
- name: 'NetStandard16'
- name: 'NetStandard20'
jobs:
include:
- stage: 'Lint markdown files'
os: linux
language: generic
install: gem install awesome_bot
script:
- find . -type f -name '*.md' -exec awesome_bot {} \;
notifications:
email: false
- &integrationtest
stage: 'Integration tests'
env: SDK=csharp SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
cache: false
language: minimal
before_install: skip
install: skip
before_script:
- mkdir $HOME/travisci-tools && pushd $HOME/travisci-tools && git init && git pull https://$CI_USER_TOKEN@github.com/optimizely/travisci-tools.git && popd
script:
- $HOME/travisci-tools/trigger-script-with-status-update.sh
after_success: travis_terminate 0
- <<: *integrationtest
stage: 'Production tests'
env:
SDK=csharp
SDK_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH
FULLSTACK_TEST_REPO=ProdTesting
- stage: 'Unit Tests'
language: csharp
dist: xenial
mono: 6.12.0
solution: "./OptimizelySDK.Travis.sln"
install:
- nuget restore ./OptimizelySDK.Travis.sln
- nuget install ./OptimizelySDK.Tests/packages.config -OutputDirectory ./packages
- nuget install NUnit.Runners -Version 2.6.4 -OutputDirectory ./testrunner
script:
- xbuild /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$TRAVIS_BUILD_DIR/keypair.snk /p:Configuration=Release ./OptimizelySDK.Travis.sln
- mono ./testrunner/NUnit.Runners.2.6.4/tools/nunit-console.exe ./OptimizelySDK.Tests/bin/Release/OptimizelySDK.Tests.dll
# strongname signing from xbuild step needs additional re-signing with sn
- find . -path './OptimizelySDK*bin/Release/OptimizelySDK*.dll' -not -regex '.*Tests.*' -print0 | while IFS= read -r -d '' file; do sn -R $file ./keypair.snk; done
after_success:
- pip install --user awscli
# upload dll build artifacts to s3 with -unsigned suffix
- ([ ${TRAVIS_BRANCH} = "$RELEASE_BRANCH" ] && [ ${TRAVIS_EVENT_TYPE} = "push" ]) && find . -path './OptimizelySDK*bin/Release/OptimizelySDK*.dll' -not -regex '.*Tests.*' -print0 | while IFS= read -r -d '' file; do (AWS_ACCESS_KEY_ID=$OFTA_KEY AWS_SECRET_ACCESS_KEY=$OFTA_SECRET AWS_DEFAULT_REGION=$OFTA_REGION aws s3 cp $file s3://optly-fs-travisci-artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/$(basename $file)-unsigned); done
- stage: 'NetStandard16'
language: csharp
# dotnet only works on trusty https://github.com/travis-ci/travis-ci/issues/5189
dist: xenial
mono: none
dotnet: 3.1
install:
- dotnet restore OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj
script:
# strongname signing is taken care of in build step
- dotnet build OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$TRAVIS_BUILD_DIR/keypair.snk -c Release
# TODO: no dotnet test yet for NetStandard16
after_success:
- pip install --user awscli
# upload dll build artifacts to s3 with -unsigned suffix
- ([ ${TRAVIS_BRANCH} = "$RELEASE_BRANCH" ] && [ ${TRAVIS_EVENT_TYPE} = "push" ]) && (AWS_ACCESS_KEY_ID=$OFTA_KEY AWS_SECRET_ACCESS_KEY=$OFTA_SECRET AWS_DEFAULT_REGION=$OFTA_REGION aws s3 cp ./OptimizelySDK.NetStandard16/bin/Release/netstandard1.6/OptimizelySDK.NetStandard16.dll s3://optly-fs-travisci-artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/OptimizelySDK.NetStandard16.dll-unsigned)
- stage: 'NetStandard20'
language: csharp
# dotnet only works on trusty https://github.com/travis-ci/travis-ci/issues/5189
dist: xenial
mono: none
dotnet: 3.1
install:
- dotnet restore OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj
script:
# strongname signing is taken care of in build step
- dotnet build OptimizelySDK.NetStandard20/OptimizelySDK.NetStandard20.csproj /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=$TRAVIS_BUILD_DIR/keypair.snk -c Release
# TODO: no dotnet test yet for NetStandard16
after_success:
- pip install --user awscli
# upload dll build artifacts to s3 with -unsigned suffix
- ([ ${TRAVIS_BRANCH} = "$RELEASE_BRANCH" ] && [ ${TRAVIS_EVENT_TYPE} = "push" ]) && (AWS_ACCESS_KEY_ID=$OFTA_KEY AWS_SECRET_ACCESS_KEY=$OFTA_SECRET AWS_DEFAULT_REGION=$OFTA_REGION aws s3 cp ./OptimizelySDK.NetStandard20/bin/Release/netstandard2.0/OptimizelySDK.NetStandard20.dll s3://optly-fs-travisci-artifacts/${TRAVIS_REPO_SLUG}/${TRAVIS_BUILD_NUMBER}/${TRAVIS_JOB_NUMBER}/OptimizelySDK.NetStandard20.dll-unsigned)
- stage: 'Source Clear'
if: type = cron
language: csharp
# dotnet only works on trusty https://github.com/travis-ci/travis-ci/issues/5189
dist: trusty
mono: none
dotnet: 2.1.502
addons:
srcclr: true
before_install: skip
install: skip
before_script: skip
script: skip
after_script: skip
after_success: skip