11on :
22 push :
33 branches : [master, release]
4- pull_request :
4+ pull_request :
55
66name : CI
77
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+
820jobs :
921 rust_tests :
1022 name : Run rust tests
@@ -15,61 +27,108 @@ jobs:
1527 fail-fast : false
1628 steps :
1729 - 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
2035 if : runner.os == 'Windows'
36+ - name : Set up the Mac environment
37+ run : brew install autoconf automake libtool
38+ if : runner.os == 'macOS'
2139 - name : Cache cargo dependencies
22- uses : actions/cache@v1
40+ uses : actions/cache@v2
2341 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') }}
2847 - name : run rust tests
2948 uses : actions-rs/cargo@v1
3049 with :
3150 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
3357
34- snippets :
35- name : Run snippets tests
58+ snippets_cpython :
59+ name : Run snippets and cpython tests
3660 runs-on : ${{ matrix.os }}
3761 strategy :
3862 matrix :
3963 os : [macos-latest, ubuntu-latest, windows-latest]
4064 fail-fast : false
4165 steps :
4266 - 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
4575 if : runner.os == 'Windows'
76+ - name : Set up the Mac environment
77+ run : brew install autoconf automake libtool
78+ if : runner.os == 'macOS'
4679 - 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'
4883 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') }}
5389 - name : build rustpython
5490 uses : actions-rs/cargo@v1
5591 with :
5692 command : build
57- args : --release --verbose --all
93+ args : --release --verbose ${{ env.CARGO_ARGS }}
5894 - uses : actions/setup-python@v1
5995 with :
60- python-version : 3.6
96+ python-version : 3.8
6197 - name : Install pipenv
6298 run : |
6399 python -V
64100 python -m pip install --upgrade pip
65101 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
68104 - name : run snippets
69105 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'
71130
72- format :
131+ lint :
73132 name : Check Rust code with rustfmt and clippy
74133 runs-on : ubuntu-latest
75134 steps :
@@ -89,48 +148,51 @@ jobs:
89148 uses : actions-rs/cargo@v1
90149 with :
91150 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
99157 - uses : actions/setup-python@v1
100158 with :
101- python-version : 3.6
159+ python-version : 3.8
102160 - name : install flake8
103161 run : python -m pip install flake8
104162 - 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
109166 runs-on : ubuntu-latest
110167 steps :
111168 - uses : actions/checkout@master
112- - name : build rustpython
113- uses : actions-rs/cargo@v1
169+ - uses : actions-rs/toolchain@v1
114170 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
121179
122180 wasm :
123181 name : Check the WASM package and demo
182+ needs : rust_tests
124183 runs-on : ubuntu-latest
125184 steps :
126185 - uses : actions/checkout@master
127186 - name : Cache cargo dependencies
128- uses : actions/cache@v1
187+ uses : actions/cache@v2
129188 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') }}
132194 restore-keys : |
133- ${{ runner.os }}-wasm-
195+ ${{ runner.os }}-debug_opt3-${{ hashFiles('**/Cargo.lock') }}
134196 - name : install wasm-pack
135197 run : curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
136198 - name : install geckodriver
@@ -140,7 +202,7 @@ jobs:
140202 tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
141203 - uses : actions/setup-python@v1
142204 with :
143- python-version : 3.6
205+ python-version : 3.8
144206 - name : Install pipenv
145207 run : |
146208 python -V
@@ -155,6 +217,13 @@ jobs:
155217 npm install
156218 npm run test
157219 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
158227 - name : Deploy demo to Github Pages
159228 if : success() && github.ref == 'refs/heads/release'
160229 uses : peaceiris/actions-gh-pages@v2
0 commit comments