.travis.yml
language: swift
os: osx
osx_image: xcode10.2
addons:
sonarcloud:
organization: "philips-software"
token:
secure: "PSIqsz4kSntpBHqaYPoEMtX/YsKYynPocsaWcqvsR2u4dE0kHKJ9Y2sLqsZfY5GTlcp+Uzuw53/gk/ze5eAZzSewXPjEnkWtB+7TytSBmjxt/1cMoFDwZXyCbSD5KhLe79eUGFi583T3qNHchUI3fM/mJLi4STLye1yPCd9EhjT4nRNg6A1BIEu6izE49W3lyt5Koq1wH1i1Kbs+cf009j5Tg0hPUMG1qhFIQd4hPHM1lVOWlVzgpF1b4DZMzBgOmt1XmknK1ncXj0ntajAaEj81DNRIfFK0Gfqi+tcyv57UavxlGErU8Tda2uqRIkk/wVsOWwMRViKS+2vPGbtVnMKNgftg8oG9RvzxuxLXovIjA6+O/+LEn3yPZKp40w5ocilLxWfcBGEKK9HPRZuvGpOJxwLw8yFbd7MM5JZXbESYfAOCG/sKjjK82aTRb4ePMSiKk5nF+DOQDg5lSR/d1hWSNwjpFfMJgxDqGfsZcDWJcVE/rzEZwJJL843/uEMVKxj/LVeQ5x6ploGmA3y93vh9138E07c2HMJL0Zk8GZSZi1KrOKAjXim5yXHndMKGxAt/bZ0QhciGzY7GJxKs+LiKi9LN3FMUZRLBrZOgtt3gL5Xc/UYAfzHMhzKm9P91fOQ447ECTuS+mtBQSDU9iw4QxIL3uABvC4qdtUQs/d8="
env:
global:
# Ruby setup
- BUNDLE_GEMFILE=.ruby-dependencies/Gemfile
# Code coverage key
- secure: QiKA+JoGk6C7PFdphqS6k9hC6p1TO7cBBhoF3NMlGo2mlwxoVnagtUpoM5kmUW2PoG49LMGxQI/oerQMSqY/dJa0df9UlffMZTs6UIBdxbbeg7Rp/gh0DMMQQGG2mokBLM8Ivm/tFxlf8Y8CHHSWgBWjKTvnlX21nTvYgqqiCfcEmae/kJgBq9M/w9cQNXFnQJm6FsTrekESBlX4CzmyWxeLWVGEvgsXTwg6FsNVIZFuiSJPflLja5X7MzizZX73jvKRHCts49/ftO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ghrHFQJKuB3x+e6qFlKQLfnYFv6Jp+BNL10R2yxhP9SNFXSu4LiXY=
# Only build the master branch, not feature branches. It will still build PRs
branches:
only:
- master
before_install:
# Use bundler 2.0
- gem uninstall --force bundler
- gem update --system --force
- gem install --force bundler
# Use recent NodeJS
- nvm install --lts
- nvm use --lts
# Use recent Yarn
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
- export PATH="$HOME/.yarn/bin:$PATH"
# Install Code Climate reporter
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
install:
# Install NodeJS dependencies, compile contracts and build packages
- yarn setup:dev
# Install fastlane for iOS builds
- (cd workspaces/cogito-ios-app && bundle install)
- (cd workspaces/telepath-ios && bundle install)
- (cd workspaces/ethers-ios && bundle install)
- (cd workspaces/cogito-attestations-ios && bundle install)
script:
# Run NodeJS tests
- yarn test --runInBand
# Run iOS app tests
- (cd workspaces/cogito-ios-app && bundle exec fastlane tests)
- (cd workspaces/telepath-ios && bundle exec fastlane tests)
- (cd workspaces/ethers-ios && bundle exec fastlane tests)
- (cd workspaces/cogito-attestations-ios && bundle exec fastlane tests)
after_success:
# Code coverage for iOS for sonar
- ./xccov-to-sonarqube-generic.sh workspaces/cogito-ios-app/Build/Logs/Test/*.xcresult/2_Test/*.xccovarchive/ > ./coverage/cogito-ios-app-coverage.xml
- ./xccov-to-sonarqube-generic.sh workspaces/telepath-ios/Build/Logs/Test/*.xcresult/2_Test/*.xccovarchive/ > ./coverage/telepath-ios-coverage.xml
- ./xccov-to-sonarqube-generic.sh workspaces/cogito-attestations-ios/Build/Logs/Test/*.xcresult/2_Test/*.xccovarchive/ > ./coverage/cogito-attestations-ios-coverage.xml
- ./xccov-to-sonarqube-generic.sh workspaces/ethers-ios/Build/Logs/Test/*.xcresult/2_Test/*.xccovarchive/ > ./coverage/ethers-ios-coverage.xml
- sonar-scanner
# Code coverage reports for iOS
- (cd workspaces/cogito-ios-app && bundle exec slather coverage -x -b ./Build -t)
- (cd workspaces/telepath-ios && bundle exec slather coverage -x -b ./Build -t)
- (cd workspaces/ethers-ios && bundle exec slather coverage -x -b ./Build -t)
- (cd workspaces/cogito-attestations-ios && bundle exec slather coverage -x -b ./Build -t)
# Convert coverage to Code Climate format
- ./cc-test-reporter format-coverage -t lcov -o coverage/codeclimate.nodejs.json
- ./cc-test-reporter format-coverage -t cobertura -o coverage/codeclimate.cogito-ios.json workspaces/cogito-ios-app/cobertura.xml
- ./cc-test-reporter format-coverage -t cobertura -o coverage/codeclimate.telepath-ios.json workspaces/telepath-ios/cobertura.xml
- ./cc-test-reporter format-coverage -t cobertura -o coverage/codeclimate.ethers-ios.json workspaces/ethers-ios/cobertura.xml
- ./cc-test-reporter format-coverage -t cobertura -o coverage/codeclimate.attestations-ios.json workspaces/cogito-attestations-ios/cobertura.xml
# Combine code coverage reports
- ./cc-test-reporter sum-coverage --parts 5 coverage/codeclimate.*.json
# Upload test coverage to Code Climate
- ./cc-test-reporter upload-coverage
before_deploy:
# Workaround for 'too many open files' in deploy step
- rm -rf workspaces/cogito-ios-app/Build
- rm -rf workspaces/telepath-ios/Build
- rm -rf workspaces/cogito-attestations-ios/Build
- rm -rf workspaces/ethers-ios/Build
deploy:
skip_cleanup: true
provider: script
script: ulimit -n 10240 && yarn deploy
on:
branch: master