Travis Windows (#519)
* Make Travis run Windows tests * Simplify git checkout
This commit is contained in:
parent
fb5ccbc407
commit
2bb2c50d79
28
.travis.yml
28
.travis.yml
@ -1,7 +1,7 @@
|
||||
language: go
|
||||
|
||||
go:
|
||||
- 1.11.x
|
||||
go: 1.11.x
|
||||
go_import_path: "storj.io/storj"
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
@ -23,9 +23,11 @@ before_script:
|
||||
|
||||
before_install:
|
||||
- source scripts/setup-gopath.sh
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- os: windows # allow failures on windows because it's slow
|
||||
include:
|
||||
### tests ###
|
||||
- env: MODE=tests
|
||||
install:
|
||||
- pushd ~
|
||||
@ -35,16 +37,36 @@ matrix:
|
||||
script:
|
||||
- go test -race -cover -coverprofile=.coverprofile ./...
|
||||
- goveralls -coverprofile=.coverprofile -service=travis-ci
|
||||
|
||||
### run linters ###
|
||||
- env: MODE=lint
|
||||
install:
|
||||
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b ${GOPATH}/bin v1.10.2
|
||||
script:
|
||||
- ./scripts/check-for-header.sh
|
||||
- golangci-lint run
|
||||
|
||||
### captplanet tests ###
|
||||
- env: MODE=integration
|
||||
install:
|
||||
- source scripts/install-awscli.sh
|
||||
- go install storj.io/storj/cmd/captplanet
|
||||
script:
|
||||
- make test-captplanet
|
||||
|
||||
### windows tests ###
|
||||
- env: MODE=windows-tests
|
||||
os: windows
|
||||
cache:
|
||||
directories:
|
||||
- "%HOME%/cache"
|
||||
before_install:
|
||||
- powershell -executionpolicy bypass -File scripts/setup-gopath.ps1
|
||||
install:
|
||||
- go get github.com/mattn/goveralls
|
||||
- go install -race ./...
|
||||
script:
|
||||
- go test -race -cover -coverprofile=.coverprofile ./...
|
||||
- goveralls -coverprofile=.coverprofile -service=travis-ci
|
||||
|
||||
fast_finish: true
|
||||
|
28
scripts/setup-gopath.ps1
Normal file
28
scripts/setup-gopath.ps1
Normal file
@ -0,0 +1,28 @@
|
||||
$xhome = $env:USERPROFILE
|
||||
|
||||
Set-Location $xhome
|
||||
|
||||
New-Item "$xhome/bin" -Force -ItemType "directory"
|
||||
New-Item "$xhome/cache" -Force -ItemType "directory"
|
||||
|
||||
$env:PATH=$env:PATH + ";$xhome/bin"
|
||||
|
||||
$env:GOSPACE_ROOT="$env:GOPATH"
|
||||
$env:GOSPACE_PKG="storj.io/storj"
|
||||
$env:GOSPACE_REPO="git@github.com:storj/storj.git"
|
||||
|
||||
# setup gospace
|
||||
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
|
||||
Invoke-WebRequest -Uri "https://github.com/storj/gospace/releases/download/v0.0.1/gospace_windows_amd64.exe" -OutFile "$xhome/bin/gospace.exe"
|
||||
|
||||
# find module dependency hash
|
||||
$modhash = gospace hash
|
||||
|
||||
# download dependencies, if we don't have them in cache
|
||||
if (!(Test-Path $xhome/cache/$modhash.zip)) {
|
||||
gospace zip-vendor $xhome/cache/$modhash.zip
|
||||
}
|
||||
|
||||
# unpack the dependencies into gopath
|
||||
gospace unzip-vendor $xhome/cache/$modhash.zip
|
||||
gospace flatten-vendor
|
@ -7,9 +7,6 @@ export GOSPACE_ROOT=$GOPATH
|
||||
export GOSPACE_PKG=storj.io/storj
|
||||
export GOSPACE_REPO=git@github.com:storj/storj/git
|
||||
|
||||
mkdir -p $GOPATH/src/storj.io
|
||||
mv $GOPATH/src/github.com/storj/storj $GOPATH/src/storj.io
|
||||
|
||||
# setup gospace
|
||||
wget -O ~/bin/gospace https://github.com/storj/gospace/releases/download/v0.0.1/gospace_linux_amd64
|
||||
chmod +x ~/bin/gospace
|
||||
@ -26,7 +23,4 @@ fi
|
||||
gospace unzip-vendor $HOME/cache/$MODHASH.zip
|
||||
gospace flatten-vendor
|
||||
|
||||
export TRAVIS_BUILD_DIR=$GOPATH/src/storj.io/storj
|
||||
cd $TRAVIS_BUILD_DIR
|
||||
|
||||
set +x
|
||||
|
Loading…
Reference in New Issue
Block a user