Skip to content

Fixing CI issue

Fixing CI issue #10

Workflow file for this run

name: CI
on:
push:
branches: ["*"]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
# Run cargo clippy --all-targets -- -D warnings
check:
strategy:
matrix:
include:
- name: Linux x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- name: Wasm
os: ubuntu-latest
target: wasm32-unknown-unknown
- name: MacOS aarch64
os: macos-14
target: aarch64-apple-darwin
name: Clippy ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-clippy-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
targets: ${{ matrix.target }}
- name: Run cargo check
run: cargo check --target ${{ matrix.target }}
- name: Run clippy
run: cargo clippy --target ${{ matrix.target }} --all-targets -- -D warnings
# Run cargo fmt --all -- --check
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Run cargo fmt
run: cargo fmt --all -- --check
# Run cargo doc --no-deps --examples --all-features --document-private-items
doc-check:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo fmt
run: cargo doc --no-deps --examples --all-features --document-private-items
# Run cargo test
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run cargo test
run: cargo test
env:
RUSTDOCFLAGS: "-D warnings"
# Run wasm-pack test
test_wasm:
name: Test Wasm
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-test-wasm-${{ hashFiles('**/Cargo.toml') }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: Tests headless chrome
run: wasm-pack test --headless --chrome
- name: Tests headless firefox
run: wasm-pack test --headless --firefox