1- language : rust
2-
3- rust :
4- - stable
5- - beta
6- - nightly
7-
8- script :
9- - cargo build --verbose --all
10- - cargo test --verbose --all
11-
12- env :
13- # This is used to only capture the regular nightly test in allow_failures
14- - REGULAR_TEST=true
15-
16- cache : cargo
1+ before_cache : |
2+ if command -v cargo; then
3+ ! command -v cargo-sweep && cargo install cargo-sweep
4+ cargo sweep -i
5+ cargo sweep -t 15
6+ fi
177
188matrix :
199 fast_finish : true
2010 include :
11+ - name : Run Rust tests
12+ language : rust
13+ rust : stable
14+ cache : cargo
15+ script :
16+ - cargo build --verbose --all
17+ - cargo test --verbose --all
18+ env :
19+ # Prevention of cache corruption.
20+ # See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
21+ - JOBCACHE=1
22+
2123 # To test the snippets, we use Travis' Python environment (because
2224 # installing rust ourselves is a lot easier than installing Python)
23- - language : python
25+ - name : Python test snippets
26+ language : python
2427 python : 3.6
2528 cache :
26- pip : true
27- # Because we're using the Python Travis environment, we can't use
28- # the built-in cargo cacher
29- directories :
30- - /home/travis/.cargo
31- - target
29+ - pip
30+ - cargo
3231 env :
32+ - JOBCACHE=2
3333 - TRAVIS_RUST_VERSION=stable
34- - REGULAR_TEST=false
3534 - CODE_COVERAGE=false
3635 script : tests/.travis-runner.sh
37- - language : python
38- python : 3.6
39- cache :
40- pip : true
41- # Because we're using the Python Travis environment, we can't use
42- # the built-in cargo cacher
43- directories :
44- - /home/travis/.cargo
45- - target
46- env :
47- - TRAVIS_RUST_VERSION=beta
48- - REGULAR_TEST=false
49- - CODE_COVERAGE=false
50- script : tests/.travis-runner.sh
51- - name : rustfmt
36+
37+ - name : Check Rust code style with rustfmt
5238 language : rust
5339 rust : stable
5440 cache : cargo
5541 before_script :
56- - rustup component add rustfmt-preview
42+ - rustup component add rustfmt
5743 script :
58- # Code references the generated python.rs, so put something in
59- # place to make `cargo fmt` happy. (We use `echo` rather than
60- # `touch` because rustfmt complains about the empty file touch
61- # creates.)
62- - echo > parser/src/python.rs
6344 - cargo fmt --all -- --check
6445 env :
65- - REGULAR_TEST=false
66- - name : publish documentation
46+ - JOBCACHE=3
47+
48+ - name : Lint Rust code with clippy
49+ language : rust
50+ rust : stable
51+ cache : cargo
52+ before_script :
53+ - rustup component add clippy
54+ script :
55+ - cargo clippy --all -- -Dwarnings
56+ env :
57+ - JOBCACHE=8
58+
59+ - name : Lint Python code with flake8
60+ language : python
61+ python : 3.6
62+ cache : pip
63+ env : JOBCACHE=9
64+ install : pip install flake8
65+ script :
66+ flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82
67+ --show-source --statistics
68+
69+ - name : Publish documentation
6770 language : rust
6871 rust : stable
6972 cache : cargo
7073 script :
7174 - cargo doc --no-deps --all
7275 if : branch = release
7376 env :
74- - REGULAR_TEST=false
75- - DEPLOY_DOC=true
77+ - JOBCACHE=4
78+ deploy :
79+ - provider : pages
80+ repo : RustPython/website
81+ target-branch : master
82+ local-dir : target/doc
83+ skip-cleanup : true
84+ # Set in the settings page of your repository, as a secure variable
85+ github-token : $WEBSITE_GITHUB_TOKEN
86+ keep-history : true
87+
7688 - name : WASM online demo
7789 language : rust
78- rust : nightly
90+ rust : stable
7991 cache : cargo
8092 install :
8193 - nvm install node
@@ -87,44 +99,38 @@ matrix:
8799 - npm run dist
88100 if : branch = release
89101 env :
90- - REGULAR_TEST=false
91- - DEPLOY_DEMO=true
92- - name : cargo-clippy
93- language : rust
94- rust : stable
95- cache : cargo
96- before_script :
97- - rustup component add clippy
98- script :
99- - cargo clippy
100- env :
101- - REGULAR_TEST=true
102+ - JOBCACHE=5
103+ deploy :
104+ - provider : pages
105+ repo : RustPython/demo
106+ target-branch : master
107+ local-dir : wasm/demo/dist
108+ skip-cleanup : true
109+ # Set in the settings page of your repository, as a secure variable
110+ github-token : $WEBSITE_GITHUB_TOKEN
111+ keep-history : true
112+
102113 - name : Code Coverage
103114 language : python
104115 python : 3.6
105116 cache :
106- pip : true
107- # Because we're using the Python Travis environment, we can't use
108- # the built-in cargo cacher
109- directories :
110- - /home/travis/.cargo
111- - target
117+ - pip
118+ - cargo
112119 script :
113120 - tests/.travis-runner.sh
121+ # Only do code coverage on master via a cron job.
122+ if : branch = master AND type = cron
114123 env :
124+ - JOBCACHE=6
115125 - TRAVIS_RUST_VERSION=nightly
116- - REGULAR_TEST=false
117126 - CODE_COVERAGE=true
118- - name : test WASM
127+
128+ - name : Test WASM
119129 language : python
120130 python : 3.6
121131 cache :
122- pip : true
123- # Because we're using the Python Travis environment, we can't use
124- # the built-in cargo cacher
125- directories :
126- - /home/travis/.cargo
127- - target
132+ - pip
133+ - cargo
128134 addons :
129135 firefox : latest
130136 install :
@@ -133,33 +139,5 @@ matrix:
133139 script :
134140 - wasm/tests/.travis-runner.sh
135141 env :
136- - REGULAR_TEST=true
142+ - JOBCACHE=7
137143 - TRAVIS_RUST_VERSION=stable
138- allow_failures :
139- - rust : nightly
140- env : REGULAR_TEST=true
141- - name : cargo-clippy
142-
143- deploy :
144- - provider : pages
145- repo : RustPython/website
146- target-branch : master
147- local-dir : target/doc
148- skip-cleanup : true
149- # Set in the settings page of your repository, as a secure variable
150- github-token : $WEBSITE_GITHUB_TOKEN
151- keep-history : true
152- on :
153- branch : release
154- condition : $DEPLOY_DOC = true
155- - provider : pages
156- repo : RustPython/demo
157- target-branch : master
158- local-dir : wasm/demo/dist
159- skip-cleanup : true
160- # Set in the settings page of your repository, as a secure variable
161- github-token : $WEBSITE_GITHUB_TOKEN
162- keep-history : true
163- on :
164- branch : release
165- condition : $DEPLOY_DEMO = true
0 commit comments