mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
162 lines
4.8 KiB
YAML
162 lines
4.8 KiB
YAML
on:
|
|
push:
|
|
branches: [master, release]
|
|
pull_request:
|
|
|
|
name: CI
|
|
|
|
env:
|
|
CARGO_ARGS: --all --features ssl
|
|
|
|
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: Set up the Windows environment
|
|
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 ${{ env.CARGO_ARGS }}
|
|
|
|
snippets_cpython:
|
|
name: Run snippets and cpython tests
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
fail-fast: false
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
- name: Set up the Windows environment
|
|
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 ${{ env.CARGO_ARGS }}
|
|
- uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.8
|
|
- 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
|
|
- name: run cpython tests
|
|
run: target/release/rustpython -m test -v
|
|
env:
|
|
RUSTPYTHONPATH: ${{ github.workspace }}/Lib
|
|
if: runner.os != 'Windows'
|
|
|
|
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: ${{ env.CARGO_ARGS }} -- -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.8
|
|
- 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
|
|
|
|
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.8
|
|
- 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
|
|
|