Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
124 changes: 76 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,95 @@
name: Automated Testing

on: push
on:
push:
branches: ["*"]

env:
CARGO_TERM_COLOR: always

jobs:
check:
name: Check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: check
- name: Checkout
uses: actions/checkout@v4

test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- name: Set up cache
uses: actions/cache@v3
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: test
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.rustup/toolchains/
target/
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }}

- name: Install WASM toolchain
run: rustup target add wasm32-unknown-unknown

- name: Check project
run: cargo clippy --workspace --all-targets --all-features -- -D warnings

format:
name: Format
- name: Check project (WASM)
# Note lack of --all-targets here because tests and examples are not wasm compatible
run: cargo clippy --workspace --all-features --target wasm32-unknown-unknown -- -D warnings

clippy-stable:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- uses: actions-rs/cargo@v1
- name: Checkout
uses: actions/checkout@v4

- name: Set up cache
uses: actions/cache@v3
with:
command: fmt
args: --all -- --check
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.rustup/toolchains/
target/
key: ${{ runner.os }}-cargo-check-stable-${{ hashFiles('**/Cargo.lock') }}

clippy:
name: Clippy
- name: Install stable toolchain
run: rustup toolchain install stable

- name: Install WASM toolchain
run: rustup target add wasm32-unknown-unknown --toolchain stable

- name: Check on stable
run: cargo +stable clippy --all-targets -- -D warnings

- name: Check project (WASM) on stable
# Note lack of --all-targets here because tests and examples are not wasm compatible
run: cargo +stable clippy --target wasm32-unknown-unknown -- -D warnings

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- uses: actions-rs/cargo@v1
- name: Checkout
uses: actions/checkout@v4

- name: Set up cache
uses: actions/cache@v3
with:
command: clippy
args: -- -D warnings
path: |
~/.cargo/.crates.toml
~/.cargo/.crates2.json
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.rustup/toolchains/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}

- name: Test project
run: RUST_BACKTRACE=1 cargo test --workspace --all-targets --all-features
15 changes: 15 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
[toolchain]
channel = "1.90"
targets = ["wasm32-unknown-unknown"]
components = [
"rustc",
"cargo",
"rustfmt",
"rust-std",
"rust-docs",
"rust-analyzer",
"clippy",
# "miri",
"rust-src",
# "rust-mingw",
# "llvm-tools",
# "rustc-dev",
]
Loading