This repository has been archived by the owner on Sep 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
/
.travis.yml
108 lines (102 loc) · 3.12 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
language: c
sudo: false
env:
global:
- DEPS_DIR=${TRAVIS_BUILD_DIR}/deps
- MEPHISTO_VERSION=v1.2.1
- LIBTRANSISTOR_BASE_VERSION=v2.2.0-rc1
matrix:
include:
- os: linux
dist: trusty
- os: osx
osx_image: xcode9.1
compiler: clang
allow_failures:
- os: osx
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-5.0
packages:
- clang-5.0
- llvm-5.0
- llvm-5.0-dev
- lld-5.0
- liblz4-dev
- squashfs-tools
- graphviz
- python3
- python3-pip
- jq
- doxygen
install:
# Set postfix variable
- export LLVM_POSTFIX=-5.0
# Download and install recent cmake (linux only)
- |
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz"
mkdir -p ${DEPS_DIR}/cmake
travis_retry wget --no-check-certificate --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${DEPS_DIR}/cmake
export PATH=${DEPS_DIR}/cmake/bin:${PATH}
fi
# Setup Mac packages (no brew plugin) and remove -5.0 postfix
- |
if [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
export LLVM_POSTFIX="";
brew install llvm qemu lz4 squashfs ;
brew upgrade python ;
export PATH="$(brew --prefix llvm)/bin:$(brew --prefix python3)/bin:$PATH";
fi
- pip3 install --user --upgrade pip setuptools wheel
before_script:
# Get Mephisto
- wget -nv https://github.com/reswitched/Mephisto/releases/download/$MEPHISTO_VERSION/ctu_$TRAVIS_OS_NAME
- chmod +x ctu_$TRAVIS_OS_NAME
# Get libtransistor-base
- wget -nv https://github.com/reswitched/libtransistor-base/releases/download/$LIBTRANSISTOR_BASE_VERSION/libtransistor-base_$LIBTRANSISTOR_BASE_VERSION.tar.gz
- mkdir dist
- tar xzf libtransistor-base_$LIBTRANSISTOR_BASE_VERSION.tar.gz -C dist
# Install Python requirements
- pip3 install --user -r dist/requirements.txt
script: make LD=ld.lld$LLVM_POSTFIX && make run_tests MEPHISTO=./ctu_$TRAVIS_OS_NAME
after_success:
# Once the build has passed, build the docs
- if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then doxygen Doxyfile; fi
# Package tests for deployment
- cd build/test/
- tar czvf tests_nro.tar.gz test_*.nro
- tar czvf tests_nso.tar.gz test_*.nso
- zip tests_nro.zip test_*.nro
- zip tests_nso.zip test_*.nso
- cd ../../
- cd dist/
- tar czvf ../libtransistor_$TRAVIS_TAG.tar.gz ./
- zip -r ../libtransistor_$TRAVIS_TAG.zip ./
- cd ../
deploy:
- provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
local-dir: docs
target-branch: gh-pages
on:
branch: development
condition: $TRAVIS_OS_NAME = linux
- provider: releases
api_key: $GITHUB_TOKEN
file:
- "libtransistor_$TRAVIS_TAG.tar.gz"
- "build/test/tests_nro.tar.gz"
- "build/test/tests_nso.tar.gz"
- "libtransistor_$TRAVIS_TAG.zip"
- "build/test/tests_nro.zip"
- "build/test/tests_nso.zip"
skip-cleanup: true
draft: true
tag_name: $TRAVIS_TAG
on:
tags: true
condition: $TRAVIS_OS_NAME = linux