1
- language : rust
2
- rust : stable
3
- 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
4
7
5
8
matrix :
6
9
fast_finish : true
7
10
include :
8
- - name : rust unittests and doctests
11
+ - name : Run Rust tests
9
12
language : rust
10
13
rust : stable
11
14
cache : cargo
12
15
script :
13
16
- cargo build --verbose --all
14
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
15
22
16
23
# To test the snippets, we use Travis' Python environment (because
17
24
# installing rust ourselves is a lot easier than installing Python)
18
- - name : python test snippets
25
+ - name : Python test snippets
19
26
language : python
20
27
python : 3.6
21
28
cache :
22
- pip : true
23
- # Because we're using the Python Travis environment, we can't use
24
- # the built-in cargo cacher
25
- directories :
26
- - /home/travis/.cargo
27
- - target
29
+ - pip
30
+ - cargo
28
31
env :
32
+ - JOBCACHE=2
29
33
- TRAVIS_RUST_VERSION=stable
30
34
- CODE_COVERAGE=false
31
35
script : tests/.travis-runner.sh
32
- - name : rustfmt
36
+
37
+ - name : Check Rust code style with rustfmt
33
38
language : rust
34
39
rust : stable
35
40
cache : cargo
36
41
before_script :
37
- - rustup component add rustfmt-preview
42
+ - rustup component add rustfmt
38
43
script :
39
- # Code references the generated python.rs, so put something in
40
- # place to make `cargo fmt` happy. (We use `echo` rather than
41
- # `touch` because rustfmt complains about the empty file touch
42
- # creates.)
43
- - echo > parser/src/python.rs
44
44
- cargo fmt --all -- --check
45
- - name : publish documentation
45
+ env :
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
46
70
language : rust
47
71
rust : stable
48
72
cache : cargo
49
73
script :
50
74
- cargo doc --no-deps --all
51
75
if : branch = release
52
76
env :
53
- - 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
+
54
88
- name : WASM online demo
55
89
language : rust
56
90
rust : stable
@@ -65,42 +99,38 @@ matrix:
65
99
- npm run dist
66
100
if : branch = release
67
101
env :
68
- - DEPLOY_DEMO=true
69
- - name : cargo-clippy
70
- language : rust
71
- rust : stable
72
- cache : cargo
73
- before_script :
74
- - rustup component add clippy
75
- script :
76
- - cargo clippy
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
+
77
113
- name : Code Coverage
78
114
language : python
79
115
python : 3.6
80
116
cache :
81
- pip : true
82
- # Because we're using the Python Travis environment, we can't use
83
- # the built-in cargo cacher
84
- directories :
85
- - /home/travis/.cargo
86
- - target
117
+ - pip
118
+ - cargo
87
119
script :
88
120
- tests/.travis-runner.sh
89
121
# Only do code coverage on master via a cron job.
90
122
if : branch = master AND type = cron
91
123
env :
124
+ - JOBCACHE=6
92
125
- TRAVIS_RUST_VERSION=nightly
93
126
- CODE_COVERAGE=true
94
- - name : test WASM
127
+
128
+ - name : Test WASM
95
129
language : python
96
130
python : 3.6
97
131
cache :
98
- pip : true
99
- # Because we're using the Python Travis environment, we can't use
100
- # the built-in cargo cacher
101
- directories :
102
- - /home/travis/.cargo
103
- - target
132
+ - pip
133
+ - cargo
104
134
addons :
105
135
firefox : latest
106
136
install :
@@ -109,30 +139,5 @@ matrix:
109
139
script :
110
140
- wasm/tests/.travis-runner.sh
111
141
env :
142
+ - JOBCACHE=7
112
143
- TRAVIS_RUST_VERSION=stable
113
- allow_failures :
114
- - name : cargo-clippy
115
-
116
- deploy :
117
- - provider : pages
118
- repo : RustPython/website
119
- target-branch : master
120
- local-dir : target/doc
121
- skip-cleanup : true
122
- # Set in the settings page of your repository, as a secure variable
123
- github-token : $WEBSITE_GITHUB_TOKEN
124
- keep-history : true
125
- on :
126
- branch : release
127
- condition : $DEPLOY_DOC = true
128
- - provider : pages
129
- repo : RustPython/demo
130
- target-branch : master
131
- local-dir : wasm/demo/dist
132
- skip-cleanup : true
133
- # Set in the settings page of your repository, as a secure variable
134
- github-token : $WEBSITE_GITHUB_TOKEN
135
- keep-history : true
136
- on :
137
- branch : release
138
- condition : $DEPLOY_DEMO = true
0 commit comments