Various fixes and updates #157
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Run when master is pushed or when anyone makes a pull request | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check rust formatting | |
run: cargo fmt -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: cargo clippy --features=rs3,pyo3 -- -D warnings | |
- run: cargo clippy --features=osrs,pyo3 -- -D warnings | |
- run: cargo clippy --features=rs3,mockdata -- -D warnings | |
- run: cargo clippy --features=osrs,mockdata -- -D warnings | |
- run: cargo check --features=legacy | |
- run: | | |
rustup target add wasm32-unknown-unknown | |
cargo clippy --target=wasm32-unknown-unknown --features=osrs -- -D warnings | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- run: cargo test --features=rs3,mockdata | |
- run: cargo test --features=osrs,mockdata | |
python: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: 'true' | |
- run: | | |
pip install nox | |
cargo xtask pytests | |
# This adds the docs to gh-pages branch | |
doc: | |
runs-on: ubuntu-latest | |
needs: | |
- fmt | |
- clippy | |
- test | |
- python | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build the doc | |
run: | | |
cargo doc --features="rs3,pyo3" --target-dir="gh-pages-build" --no-deps --workspace --exclude="osrs" | |
echo "<meta http-equiv=refresh content=0;url=rs3cache/index.html>" > gh-pages-build/doc/index.html | |
- name: Deploy | |
if: ${{ github.ref == 'refs/heads/master' }} | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./gh-pages-build/doc | |
destination_dir: . | |
full_commit_message: "Upload documentation" |