mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
207 lines
5.3 KiB
YAML
207 lines
5.3 KiB
YAML
before_cache:
|
|
- |
|
|
if command -v cargo; then
|
|
if ! command -v cargo-sweep; then
|
|
cargo install cargo-sweep
|
|
fi
|
|
cargo sweep -i
|
|
cargo sweep -t 15
|
|
fi
|
|
- rm -rf ~/.cargo/registry/src
|
|
|
|
matrix:
|
|
fast_finish: true
|
|
include:
|
|
- name: Run Rust tests(linux)
|
|
language: rust
|
|
os: linux
|
|
rust: stable
|
|
cache: cargo
|
|
script:
|
|
- cargo build --verbose --all
|
|
- cargo test --verbose --all
|
|
env:
|
|
# Prevention of cache corruption.
|
|
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
|
|
- JOBCACHE=1
|
|
|
|
- name: Run Rust tests(osx)
|
|
language: rust
|
|
os: osx
|
|
rust: stable
|
|
cache: cargo
|
|
script:
|
|
- cargo build --verbose --all
|
|
- cargo test --verbose --all
|
|
env:
|
|
# Prevention of cache corruption.
|
|
# See: https://docs.travis-ci.com/user/caching/#caches-and-build-matrices
|
|
- JOBCACHE=11
|
|
|
|
# To test the snippets, we use Travis' Python environment (because
|
|
# installing rust ourselves is a lot easier than installing Python)
|
|
- name: Python test snippets
|
|
language: python
|
|
python: 3.6
|
|
cache:
|
|
- pip
|
|
- cargo
|
|
env:
|
|
- JOBCACHE=2
|
|
- TRAVIS_RUST_VERSION=stable
|
|
- CODE_COVERAGE=false
|
|
script: tests/.travis-runner.sh
|
|
|
|
- name: Check Rust code style with rustfmt
|
|
language: rust
|
|
rust: stable
|
|
cache: cargo
|
|
before_script:
|
|
- rustup component add rustfmt
|
|
script:
|
|
- cargo fmt --all -- --check
|
|
env:
|
|
- JOBCACHE=3
|
|
|
|
- name: Lint Rust code with clippy
|
|
language: rust
|
|
rust: stable
|
|
cache: cargo
|
|
before_script:
|
|
- rustup component add clippy
|
|
script:
|
|
- cargo clippy --all -- -Dwarnings
|
|
env:
|
|
- JOBCACHE=8
|
|
|
|
- name: Lint Python code with flake8
|
|
language: python
|
|
python: 3.6
|
|
cache: pip
|
|
env: JOBCACHE=9
|
|
install: pip install flake8
|
|
script:
|
|
flake8 . --count --exclude=./.*,./Lib,./vm/Lib --select=E9,F63,F7,F82
|
|
--show-source --statistics
|
|
|
|
- name: Publish documentation
|
|
language: rust
|
|
rust: stable
|
|
cache: cargo
|
|
script:
|
|
- cargo doc --no-deps --all
|
|
if: branch = release
|
|
env:
|
|
- JOBCACHE=4
|
|
deploy:
|
|
- provider: pages
|
|
repo: RustPython/website
|
|
target-branch: master
|
|
local-dir: target/doc
|
|
skip-cleanup: true
|
|
# Set in the settings page of your repository, as a secure variable
|
|
github-token: $WEBSITE_GITHUB_TOKEN
|
|
keep-history: true
|
|
on:
|
|
branch: release
|
|
|
|
- name: WASM online demo
|
|
language: rust
|
|
rust: stable
|
|
cache: cargo
|
|
install:
|
|
- nvm install node
|
|
# install wasm-pack
|
|
- curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
script:
|
|
- cd wasm/demo
|
|
- npm install
|
|
- npm run dist
|
|
if: branch = release
|
|
env:
|
|
- JOBCACHE=5
|
|
deploy:
|
|
- provider: pages
|
|
repo: RustPython/demo
|
|
target-branch: master
|
|
local-dir: wasm/demo/dist
|
|
skip-cleanup: true
|
|
# Set in the settings page of your repository, as a secure variable
|
|
github-token: $WEBSITE_GITHUB_TOKEN
|
|
keep-history: true
|
|
on:
|
|
branch: release
|
|
|
|
- name: Code Coverage
|
|
language: python
|
|
python: 3.6
|
|
cache:
|
|
- pip
|
|
- cargo
|
|
script:
|
|
- tests/.travis-runner.sh
|
|
# Only do code coverage on master via a cron job.
|
|
if: branch = master AND type = cron
|
|
env:
|
|
- JOBCACHE=6
|
|
- TRAVIS_RUST_VERSION=nightly
|
|
- CODE_COVERAGE=true
|
|
|
|
- name: Test WASM
|
|
language: python
|
|
python: 3.6
|
|
cache:
|
|
- pip
|
|
- cargo
|
|
addons:
|
|
firefox: latest
|
|
install:
|
|
- nvm install node
|
|
- pip install pipenv
|
|
script:
|
|
- wasm/tests/.travis-runner.sh
|
|
env:
|
|
- JOBCACHE=7
|
|
- TRAVIS_RUST_VERSION=stable
|
|
|
|
- name: Ensure compilation on Redox OS with Redoxer
|
|
# language: minimal so that it actually uses bionic rather than xenial;
|
|
# rust isn't yet available on bionic
|
|
language: minimal
|
|
dist: bionic
|
|
if: type = cron
|
|
cache:
|
|
cargo: true
|
|
directories:
|
|
- $HOME/.redoxer
|
|
- $HOME/.cargo
|
|
before_install:
|
|
# install rust as travis does for language: rust
|
|
- curl -sSf https://build.travis-ci.org/files/rustup-init.sh | sh -s --
|
|
--default-toolchain=$TRAVIS_RUST_VERSION -y
|
|
- export PATH=${TRAVIS_HOME}/.cargo/bin:$PATH
|
|
- rustc --version
|
|
- rustup --version
|
|
- cargo --version
|
|
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get install libfuse-dev
|
|
install:
|
|
- if ! command -v redoxer; then cargo install redoxfs redoxer; fi
|
|
- redoxer install
|
|
script:
|
|
- bash redox/uncomment-cargo.sh
|
|
- redoxer build --verbose
|
|
- bash redox/comment-cargo.sh
|
|
before_cache:
|
|
- |
|
|
if ! command -v cargo-sweep; then
|
|
rustup install stable
|
|
cargo +stable install cargo-sweep
|
|
fi
|
|
- cargo sweep -t 15
|
|
- rm -rf ~/.cargo/registry/src
|
|
env:
|
|
- JOBCACHE=10
|
|
- TRAVIS_RUST_VERSION=nightly
|