forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
206 lines (194 loc) · 5.34 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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
before_cache:
- |
if command -v cargo; then
if ! command -v cargo-sweep; then
cargo install cargo-sweep
fi
cargo sweep -i
cargo sweep -t 15
fi
- rm -rf ~/.cargo/registry/src
matrix:
fast_finish: true
include:
- name: Run Rust tests(linux)
language: rust
os: linux
rust: stable
cache: cargo
script:
- cargo build --verbose --all
- cargo test --verbose --all
env:
# Prevention of cache corruption.
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
- JOBCACHE=1
- name: Run Rust tests(osx)
language: rust
os: osx
rust: stable
cache: cargo
script:
- cargo build --verbose --all
- cargo test --verbose --all
env:
# Prevention of cache corruption.
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
- JOBCACHE=11
# To test the snippets, we use Travis' Python environment (because
# installing rust ourselves is a lot easier than installing Python)
- name: Python test snippets
language: python
python: 3.6
cache:
- pip
- cargo
env:
- JOBCACHE=2
- TRAVIS_RUST_VERSION=stable
- CODE_COVERAGE=false
script: tests/.travis-runner.sh
- name: Check Rust code style with rustfmt
language: rust
rust: stable
cache: cargo
before_script:
- rustup component add rustfmt
script:
- cargo fmt --all -- --check
env:
- JOBCACHE=3
- name: Lint Rust code with clippy
language: rust
rust: stable
cache: cargo
before_script:
- rustup component add clippy
script:
- cargo clippy --all -- -Dwarnings
env:
- JOBCACHE=8
- name: Lint Python code with flake8
language: python
python: 3.6
cache: pip
env: JOBCACHE=9
install: pip install flake8
script:
flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82
--show-source --statistics
- name: Publish documentation
language: rust
rust: stable
cache: cargo
script:
- cargo doc --no-deps --all
if: branch = release
env:
- JOBCACHE=4
deploy:
- provider: pages
repo: RustPython/website
target-branch: master
local-dir: target/doc
skip-cleanup: true
# Set in the settings page of your repository, as a secure variable
github-token: $WEBSITE_GITHUB_TOKEN
keep-history: true
on:
branch: release
- name: WASM online demo
language: rust
rust: stable
cache: cargo
install:
- nvm install node
# install wasm-pack
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
script:
- cd wasm/demo
- npm install
- npm run dist
if: branch = release
env:
- JOBCACHE=5
deploy:
- provider: pages
repo: RustPython/demo
target-branch: master
local-dir: wasm/demo/dist
skip-cleanup: true
# Set in the settings page of your repository, as a secure variable
github-token: $WEBSITE_GITHUB_TOKEN
keep-history: true
on:
branch: release
- name: Code Coverage
language: python
python: 3.6
cache:
- pip
- cargo
script:
- tests/.travis-runner.sh
# Only do code coverage on master via a cron job.
if: branch = master AND type = cron
env:
- JOBCACHE=6
- TRAVIS_RUST_VERSION=nightly
- CODE_COVERAGE=true
- name: Test WASM
language: python
python: 3.6
cache:
- pip
- cargo
addons:
firefox: latest
install:
- nvm install node
- pip install pipenv
script:
- wasm/tests/.travis-runner.sh
env:
- JOBCACHE=7
- TRAVIS_RUST_VERSION=stable
- name: Ensure compilation on Redox OS with Redoxer
# language: minimal so that it actually uses bionic rather than xenial;
# rust isn't yet available on bionic
language: minimal
dist: bionic
if: type = cron
cache:
cargo: true
directories:
- $HOME/.redoxer
- $HOME/.cargo
before_install:
# install rust as travis does for language: rust
- curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s --
--default-toolchain=$TRAVIS_RUST_VERSION -y
- export PATH=${TRAVIS_HOME}/.cargo/bin:$PATH
- rustc --version
- rustup --version
- cargo --version
- sudo apt-get update -qq
- sudo apt-get install libfuse-dev
install:
- if ! command -v redoxer; then cargo install redoxfs redoxer; fi
- redoxer install
script:
- bash redox/uncomment-cargo.sh
- redoxer build --verbose
- bash redox/comment-cargo.sh
before_cache:
- |
if ! command -v cargo-sweep; then
rustup install stable
cargo +stable install cargo-sweep
fi
- cargo sweep -t 15
- rm -rf ~/.cargo/registry/src
env:
- JOBCACHE=10
- TRAVIS_RUST_VERSION=nightly