1
1
on :
2
2
push :
3
3
branches : [master, release]
4
- pull_request :
4
+ pull_request :
5
5
6
6
name : CI
7
7
8
+ env :
9
+ CARGO_ARGS : --features "ssl jit"
10
+ NON_WASM_PACKAGES : >
11
+ -p rustpython-bytecode
12
+ -p rustpython-common
13
+ -p rustpython-compiler
14
+ -p rustpython-parser
15
+ -p rustpython-vm
16
+ -p rustpython-jit
17
+ -p rustpython-derive
18
+ -p rustpython
19
+
8
20
jobs :
9
21
rust_tests :
10
22
name : Run rust tests
@@ -15,61 +27,108 @@ jobs:
15
27
fail-fast : false
16
28
steps :
17
29
- uses : actions/checkout@master
18
- - name : Convert symlinks to hardlink (windows only)
19
- run : powershell.exe scripts/symlinks-to-hardlinks.ps1
30
+ - uses : actions-rs/toolchain@v1
31
+ - name : Set up the Windows environment
32
+ run : |
33
+ choco install llvm
34
+ powershell.exe scripts/symlinks-to-hardlinks.ps1
20
35
if : runner.os == 'Windows'
36
+ - name : Set up the Mac environment
37
+ run : brew install autoconf automake libtool
38
+ if : runner.os == 'macOS'
21
39
- name : Cache cargo dependencies
22
- uses : actions/cache@v1
40
+ uses : actions/cache@v2
23
41
with :
24
- key : ${{ runner.os }}-rust_tests-${{ hashFiles('Cargo.lock') }}
25
- path : target
26
- restore-keys : |
27
- ${{ runner.os }}-rust_tests-
42
+ path : |
43
+ ~/.cargo/registry
44
+ ~/.cargo/git
45
+ target
46
+ key : ${{ runner.os }}-debug_opt3-${{ hashFiles('**/Cargo.lock') }}
28
47
- name : run rust tests
29
48
uses : actions-rs/cargo@v1
30
49
with :
31
50
command : test
32
- args : --verbose --all
51
+ args : --verbose ${{ env.CARGO_ARGS }} ${{ env.NON_WASM_PACKAGES }}
52
+ - name : check compilation without threading
53
+ uses : actions-rs/cargo@v1
54
+ with :
55
+ command : check
56
+ args : ${{ env.CARGO_ARGS }} --no-default-features
33
57
34
- snippets :
35
- name : Run snippets tests
58
+ snippets_cpython :
59
+ name : Run snippets and cpython tests
36
60
runs-on : ${{ matrix.os }}
37
61
strategy :
38
62
matrix :
39
63
os : [macos-latest, ubuntu-latest, windows-latest]
40
64
fail-fast : false
41
65
steps :
42
66
- uses : actions/checkout@master
43
- - name : Convert symlinks to hardlink (windows only)
44
- run : powershell.exe scripts/symlinks-to-hardlinks.ps1
67
+ - uses : actions-rs/toolchain@v1
68
+ - uses : actions/setup-python@v2
69
+ with :
70
+ python-version : 3.8
71
+ - name : Set up the Windows environment
72
+ run : |
73
+ choco install llvm
74
+ powershell.exe scripts/symlinks-to-hardlinks.ps1
45
75
if : runner.os == 'Windows'
76
+ - name : Set up the Mac environment
77
+ run : brew install autoconf automake libtool
78
+ if : runner.os == 'macOS'
46
79
- name : Cache cargo dependencies
47
- uses : actions/cache@v1
80
+ uses : actions/cache@v2
81
+ # cache gets corrupted for some reason on mac
82
+ if : runner.os != 'macOS'
48
83
with :
49
- key : ${{ runner.os }}-snippets-${{ hashFiles('Cargo.lock') }}
50
- path : target
51
- restore-keys : |
52
- ${{ runner.os }}-snippets-
84
+ path : |
85
+ ~/.cargo/registry
86
+ ~/.cargo/git
87
+ target
88
+ key : ${{ runner.os }}-release-${{ hashFiles('**/Cargo.lock') }}
53
89
- name : build rustpython
54
90
uses : actions-rs/cargo@v1
55
91
with :
56
92
command : build
57
- args : --release --verbose --all
93
+ args : --release --verbose ${{ env.CARGO_ARGS }}
58
94
- uses : actions/setup-python@v1
59
95
with :
60
- python-version : 3.6
96
+ python-version : 3.8
61
97
- name : Install pipenv
62
98
run : |
63
99
python -V
64
100
python -m pip install --upgrade pip
65
101
python -m pip install pipenv
66
- - run : pipenv install
67
- working-directory : ./tests
102
+ - run : pipenv install --python 3.8
103
+ working-directory : ./extra_tests
68
104
- name : run snippets
69
105
run : pipenv run pytest -v
70
- working-directory : ./tests
106
+ working-directory : ./extra_tests
107
+ - name : run cpython tests
108
+ run : target/release/rustpython -m test -v
109
+ env :
110
+ RUSTPYTHONPATH : ${{ github.workspace }}/Lib
111
+ if : runner.os == 'Linux'
112
+ - name : run cpython tests (macOS lightweight)
113
+ run :
114
+ target/release/rustpython -m test -v -x
115
+ test_argparse test_json test_bytes test_bytearray test_long test_unicode test_array
116
+ test_asyncgen test_list test_complex test_json test_set test_dis test_calendar
117
+ env :
118
+ RUSTPYTHONPATH : ${{ github.workspace }}/Lib
119
+ if : runner.os == 'macOS'
120
+ - name : run cpython tests (windows partial - fixme)
121
+ run :
122
+ target/release/rustpython -m test -v -x
123
+ test_argparse test_json test_bytes test_long test_pwd test_bool test_cgi test_complex
124
+ test_exception_hierarchy test_glob test_iter test_list test_os test_pathlib
125
+ test_py_compile test_set test_shutil test_sys test_unicode test_unittest test_venv
126
+ test_zipimport test_importlib test_io
127
+ env :
128
+ RUSTPYTHONPATH : ${{ github.workspace }}/Lib
129
+ if : runner.os == 'Windows'
71
130
72
- format :
131
+ lint :
73
132
name : Check Rust code with rustfmt and clippy
74
133
runs-on : ubuntu-latest
75
134
steps :
@@ -89,48 +148,51 @@ jobs:
89
148
uses : actions-rs/cargo@v1
90
149
with :
91
150
command : clippy
92
- args : --all -- -Dwarnings
93
-
94
- lint :
95
- name : Lint Python code with flake8
96
- runs-on : ubuntu-latest
97
- steps :
98
- - uses : actions/checkout@master
151
+ args : ${{ env.CARGO_ARGS }} ${{ env.NON_WASM_PACKAGES }} -- -Dwarnings
152
+ - name : run clippy on wasm
153
+ uses : actions-rs/cargo@v1
154
+ with :
155
+ command : clippy
156
+ args : --manifest-path=wasm/lib/Cargo.toml -- -Dwarnings
99
157
- uses : actions/setup-python@v1
100
158
with :
101
- python-version : 3.6
159
+ python-version : 3.8
102
160
- name : install flake8
103
161
run : python -m pip install flake8
104
162
- name : run lint
105
- run : flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82 --show-source --statistics
106
-
107
- cpython :
108
- name : Run CPython test suite
163
+ run : flake8 . --count --exclude=./.*,./Lib,./vm/Lib,./benches/ --select=E9,F63,F7,F82 --show-source --statistics
164
+ miri :
165
+ name : Run tests under miri
109
166
runs-on : ubuntu-latest
110
167
steps :
111
168
- uses : actions/checkout@master
112
- - name : build rustpython
113
- uses : actions-rs/cargo@v1
169
+ - uses : actions-rs/toolchain@v1
114
170
with :
115
- command : build
116
- args : --verbose --all
117
- - name : run tests
118
- run : |
119
- export RUSTPYTHONPATH=`pwd`/Lib
120
- cargo run -- -m test -v
171
+ profile : minimal
172
+ toolchain : nightly
173
+ components : miri
174
+ override : true
175
+ - name : Run tests under miri
176
+ # miri-ignore-leaks because the type-object circular reference means that there will always be
177
+ # a memory leak, at least until we have proper cyclic gc
178
+ run : MIRIFLAGS='-Zmiri-ignore-leaks' cargo +nightly miri test -p rustpython-vm -- miri_test
121
179
122
180
wasm :
123
181
name : Check the WASM package and demo
182
+ needs : rust_tests
124
183
runs-on : ubuntu-latest
125
184
steps :
126
185
- uses : actions/checkout@master
127
186
- name : Cache cargo dependencies
128
- uses : actions/cache@v1
187
+ uses : actions/cache@v2
129
188
with :
130
- key : ${{ runner.os }}-wasm-${{ hashFiles('**/Cargo.lock') }}
131
- path : target
189
+ path : |
190
+ ~/.cargo/registry
191
+ ~/.cargo/git
192
+ target
193
+ key : ${{ runner.os }}-wasm_opt3-${{ hashFiles('**/Cargo.lock') }}
132
194
restore-keys : |
133
- ${{ runner.os }}-wasm-
195
+ ${{ runner.os }}-debug_opt3-${{ hashFiles('**/Cargo.lock') }}
134
196
- name : install wasm-pack
135
197
run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
136
198
- name : install geckodriver
@@ -140,7 +202,7 @@ jobs:
140
202
tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
141
203
- uses : actions/setup-python@v1
142
204
with :
143
- python-version : 3.6
205
+ python-version : 3.8
144
206
- name : Install pipenv
145
207
run : |
146
208
python -V
@@ -155,6 +217,13 @@ jobs:
155
217
npm install
156
218
npm run test
157
219
working-directory : ./wasm/demo
220
+ - name : build notebook demo
221
+ if : github.ref == 'refs/heads/release'
222
+ run : |
223
+ npm install
224
+ npm run dist
225
+ mv dist ../demo/dist/notebook
226
+ working-directory : ./wasm/notebook
158
227
- name : Deploy demo to Github Pages
159
228
if : success() && github.ref == 'refs/heads/release'
160
229
uses : peaceiris/actions-gh-pages@v2
0 commit comments