forked from mullvad/mullvadvpn-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
156 lines (145 loc) · 5.79 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
git:
submodules: false
before_install:
- git submodule update --init
matrix:
include:
# GUI - Electron
- language: node_js
node_js: '12'
name: Desktop Frontend, Linux
cache: npm
services:
- xvfb
before_install:
- npm install -g npm
install: &node_install
- npm --version
- node --version
- cd gui
- npm ci --no-optional
script: &node_script
- npm run check-format
- npm run lint
- npm run build
- npm test
- os: windows
language: node_js
node_js: '12'
name: Desktop Frontend, Windows
cache: npm
before_install:
# npm fails to upgrade itself if just doing `npm install -g npm`. See this issue:
# https://travis-ci.community/t/command-npm-i-g-npm-latest-fails/431/5
- node `npm prefix -g`/node_modules/npm/bin/npm-cli.js i -g npm@latest
install: *node_install
script: *node_script
# Android
- language: android
name: Android
android:
components:
- android-28
- build-tools-28.0.3
install:
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable --profile minimal -y
- source $HOME/.cargo/env
- rustup target add aarch64-linux-android
- curl -sf -L -o /tmp/ndk.zip https://dl.google.com/android/repository/android-ndk-r20-linux-x86_64.zip
- sudo mkdir /opt/android
- sudo unzip -q -d /opt/android/ /tmp/ndk.zip
- sudo /opt/android/android-ndk-r20/build/tools/make-standalone-toolchain.sh --platform=android-21 --arch=arm64 --install-dir=/opt/android/toolchains/android21-aarch64
- |
curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.34.2/ktlint &&
chmod a+x ktlint &&
sudo mv ktlint /usr/local/bin/
- |
cat >> $HOME/.cargo/config << EOF
[target.aarch64-linux-android]
ar = "/opt/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar"
linker = "/opt/android/android-ndk-r20/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang"
before_script:
- export RUSTFLAGS="--deny unused_imports --deny dead_code --deny unused_mut --deny unused_variables"
- export AR_aarch64_linux_android=/opt/android/toolchains/android21-aarch64/bin/aarch64-linux-android-ar
- export CC_aarch64_linux_android=/opt/android/toolchains/android21-aarch64/bin/aarch64-linux-android21-clang
- source env.sh aarch64-linux-android
- env
script:
- ./wireguard/build-wireguard-go.sh --android
- cargo build --target aarch64-linux-android --verbose --package mullvad-jni
- cd android
- ./gradlew --console plain assembleDebug
# Run ktlint with extra andorid rules
- ktlint -a
# Daemon - macOS
- language: rust
rust: stable
name: Daemon, macOS - stable Rust
os: osx
before_script:
- env
# installing Go
- curl -s https://dl.google.com/go/go1.13.6.darwin-amd64.pkg --output go-installer.pkg
- sudo installer -pkg ./go-installer.pkg -target /
- export PATH="/usr/local/go/bin:$PATH"
script:
- ./ci/ci-rust-script.sh stable
# Daemon - Linux
- os: linux
name: Daemon, Linux - nightly Rust
language: minimal
dist: xenial
services: docker
before_script: &rust_before_script
- docker --version
# --privileged is required because nightly cargo uses statx instead of stat, and that
# syscall is so new that it's not on the docker whitelist yet.
# https://github.com/rust-lang/rust/issues/65662
- docker run -d --privileged --name mvd-build -v $(pwd):/travis -w /travis mullvadvpn/mullvadvpn-app-build:latest tail -f /dev/null
- docker ps
script:
- docker exec -t mvd-build bash ci/ci-rust-script.sh nightly
- os: linux
name: Daemon, Linux - beta Rust
language: minimal
dist: xenial
services: docker
before_script: *rust_before_script
script:
- docker exec -t mvd-build bash ci/ci-rust-script.sh beta
- os: linux
name: Daemon, Linux - stable Rust
language: minimal
dist: xenial
services: docker
before_script: *rust_before_script
script:
- docker exec -t mvd-build bash ci/ci-rust-script.sh stable
# Daemon - Windows
- os: windows
name: Daemon, Windows - stable Rust
env: RUST_VERSION=stable
language: shell
before_install: &rust_windows_before_install
- curl -s https://download.visualstudio.microsoft.com/download/pr/57d28351-e762-4ee1-aca4-16b6d3faaa33/34fa4c9bb790f310c908ff59071949289dc3ed503bcb44723c2e0b360c51ebab/vs_BuildTools.exe --output vs_BuildTools.exe
- echo "34fa4c9bb790f310c908ff59071949289dc3ed503bcb44723c2e0b360c51ebab vs_BuildTools.exe" | sha256sum -c
- ./vs_BuildTools.exe --wait -q --norestart --add Microsoft.VisualStudio.Workload.VCTools\;includeRecommended --add Microsoft.Component.MSBuild --add Microsoft.VisualStudio.Component.VC.ATL
- git submodule update --init
# Installing Go
- curl -s https://dl.google.com/go/go1.13.6.windows-amd64.msi --output go-installer.msi
- cmd.exe '/c msiexec /i go-installer.msi /quiet /qn'
- export PATH="/c/Go/bin/:$PATH"
script: &rust_windows_script
- ./ci/ci-rust-script.sh $RUST_VERSION
- os: windows
name: Daemon, Windows - beta Rust
env: RUST_VERSION=beta
language: shell
before_install: *rust_windows_before_install
script: *rust_windows_script
allow_failures:
- name: Desktop Frontend, Windows
notifications:
email:
on_success: never
on_failure: never