forked from WalletConnect/Web3.swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (44 loc) · 1.67 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
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage
# Run tests on Ubuntu and macOS
os:
- linux
- osx
# Ubuntu 20.04
dist: focal
# Generic language as travis doesn't know anything about SPM and Linux
language: generic
sudo: required
osx_image: xcode12
xcode_sdk: iphonesimulator14.0
before_install:
- if [ $TRAVIS_OS_NAME == "osx" ]; then instruments -s devices; fi
- if [ $TRAVIS_OS_NAME == "osx" ]; then
echo "macOS build. swiftenv will not be installed.";
echo "Installing llvm for test coverage conversion.";
brew install llvm;
else
echo "Installing Linux Swift dependencies.";
sudo apt-get -q install -y libz3-4;
echo "Installing swiftenv and Swift version specified in .swift-version.";
git clone https://github.com/kylef/swiftenv.git ~/.swiftenv;
export SWIFTENV_ROOT="$HOME/.swiftenv";
export PATH="$SWIFTENV_ROOT/bin:$PATH";
eval "$(swiftenv init -)";
swiftenv install $(cat .swift-version);
fi
script:
# Output something every 10 minutes or Travis kills the job
- while sleep 60; do echo "=====[ $SECONDS seconds still running ]====="; done &
# Actual script
- swift build
- swift build -c release
- swift test --enable-code-coverage
# Kill background echo job
- kill %1
after_success:
- if [ $TRAVIS_OS_NAME == "osx" ]; then
xcrun llvm-cov export -format="lcov" .build/debug/Web3PackageTests.xctest/Contents/MacOS/Web3PackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov;
bash <(curl https://raw.githubusercontent.com/codecov/codecov-bash/9d9a1b61c04e8aea9ebb8c200d1fbc399eb6cc99/codecov);
fi