forked from RustPython/RustPython
-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (158 loc) · 4.85 KB
/
Copy pathci.yaml
File metadata and controls
166 lines (158 loc) · 4.85 KB
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
on:
push:
branches: [master, release]
pull_request:
name: CI
jobs:
rust_tests:
name: Run rust tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@master
- name: Convert symlinks to hardlink (windows only)
run: powershell.exe scripts/symlinks-to-hardlinks.ps1
if: runner.os == 'Windows'
- name: Cache cargo dependencies
uses: actions/cache@v1
with:
key: ${{ runner.os }}-rust_tests-${{ hashFiles('Cargo.lock') }}
path: target
restore-keys: |
${{ runner.os }}-rust_tests-
- name: run rust tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --all
snippets:
name: Run snippets tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false
steps:
- uses: actions/checkout@master
- name: Convert symlinks to hardlink (windows only)
run: powershell.exe scripts/symlinks-to-hardlinks.ps1
if: runner.os == 'Windows'
- name: Cache cargo dependencies
uses: actions/cache@v1
with:
key: ${{ runner.os }}-snippets-${{ hashFiles('Cargo.lock') }}
path: target
restore-keys: |
${{ runner.os }}-snippets-
- name: build rustpython
uses: actions-rs/cargo@v1
with:
command: build
args: --release --verbose --all
- uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install pipenv
run: |
python -V
python -m pip install --upgrade pip
python -m pip install pipenv
- run: pipenv install
working-directory: ./tests
- name: run snippets
run: pipenv run pytest -v
working-directory: ./tests
format:
name: Check Rust code with rustfmt and clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- name: run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -Dwarnings
lint:
name: Lint Python code with flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
with:
python-version: 3.6
- name: install flake8
run: python -m pip install flake8
- name: run lint
run: flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82 --show-source --statistics
cpython:
name: Run CPython test suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: build rustpython
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --all
- name: run tests
run: |
export RUSTPYTHONPATH=`pwd`/Lib
cargo run -- -m test -v
wasm:
name: Check the WASM package and demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Cache cargo dependencies
uses: actions/cache@v1
with:
key: ${{ runner.os }}-wasm-${{ hashFiles('**/Cargo.lock') }}
path: target
restore-keys: |
${{ runner.os }}-wasm-
- name: install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: install geckodriver
run: |
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
mkdir geckodriver
tar -xzf geckodriver-v0.24.0-linux32.tar.gz -C geckodriver
- uses: actions/setup-python@v1
with:
python-version: 3.6
- name: Install pipenv
run: |
python -V
python -m pip install --upgrade pip
python -m pip install pipenv
- run: pipenv install
working-directory: ./wasm/tests
- uses: actions/setup-node@v1
- name: run test
run: |
export PATH=$PATH:`pwd`/../../geckodriver
npm install
npm run test
working-directory: ./wasm/demo
- name: Deploy demo to Github Pages
if: success() && github.ref == 'refs/heads/release'
uses: peaceiris/actions-gh-pages@v2
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEMO_DEPLOY_KEY }}
PUBLISH_DIR: ./wasm/demo/dist
EXTERNAL_REPOSITORY: RustPython/demo
PUBLISH_BRANCH: master